-
-
Notifications
You must be signed in to change notification settings - Fork 98
Support for multiple device profiles #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Change "No primary device" card to "No device configured" with clearer messaging - Replace troubleshoot action with "Manage devices" button that navigates to device manager - Move troubleshooter from overview to Settings → Support section - Add concise troubleshooter description for settings preference - Update navigation to support troubleshooter access from settings - Improve user experience by providing more intuitive device management flow
This commit removes the "Show all devices" toggle from General Settings. The app will now always display all nearby Bluetooth devices in the overview, simplifying the UI and device discovery. The corresponding preference `core.showall.enabled` and its usage have been removed. The debug setting `showUnfiltered` no longer affects this behavior.
- Merged all 76 locale strings.xml files from app-common to app module - Removed app-common module dependency from app/build.gradle.kts - Removed app-common from settings.gradle - Fixed all BuildConfig and R class import statements - Updated fully qualified R references from eu.darken.capod.common.R to R - Deleted entire app-common directory and all associated files - Added temporary fallback for missing GITSHA BuildConfig field The project now has a simplified structure with all string resources consolidated in the app module, eliminating the unnecessary app-common module while maintaining full functionality. Builds successfully for both FOSS and Google Play variants.
- Add UnmatchedDevicesCard to show/hide devices without profiles - Separate devices with profiles from unmatched devices in overview - Add priority-based sorting (profile.priority with 0 = highest) - Add compiler args for experimental unsigned types and annotation targets - Add string resources for unmatched devices UI - Refactor overview to handle both profiled and non-profiled devices The UI now shows: 1. Devices with configured profiles first (sorted by priority) 2. Collapsible section for unmatched devices with toggle button 3. Session-persistent show/hide state for unmatched devices
- Implement DeviceProfile interface with sealed interface pattern - Add AppleDeviceProfile for Apple devices with IRK support - Create DeviceProfilesRepo for profile persistence with Moshi - Add NameBasedPolyJsonAdapterFactory for polymorphic JSON serialization - Update PodDevice.Meta to include profile reference - Extend ApplePods with AppleMeta containing profile information - Add utility extensions for profile-based device filtering This establishes the foundation for device profile management system.
- Update all Apple device classes to use AppleMeta with profile support - Modify device factories to inject profile information during creation - Update UI components to handle profile-aware device metadata - Refactor reaction systems to work with profile-based devices - Update monitor worker and cache to support profile relationships - Ensure consistent meta structure across all device types All devices now properly reference their associated profiles through the meta.profile field, enabling profile-based functionality.
The subtitle showing the number of items in the list was only visible in debug builds and has been removed.
This commit updates the `OverviewFragment` to use the `androidx.core.net.toUri()` extension function when creating Uris for system settings intents. This replaces the direct usage of `Uri.parse()`.
This commit introduces a new UI for creating and editing device profiles. Users can now define profile names, select device models, set minimum signal quality, and optionally add identity and encryption keys. The device manager screen now supports drag-and-drop reordering of profiles. The order of profiles in the list now determines their priority, with items at the top having higher priority. The internal data structure for device profiles has been updated, and the `PodMonitor` now sorts devices based on this new profile priority.
This commit renames the `devices` package and its contents to `profiles` for better clarity and consistency. This includes renaming classes, files, and updating import statements and navigation graph references.
The `titleTextAppearance` was removed from the toolbar in `device_profile_creation_fragment.xml` to use the default appearance.
- Fix navigation bar overlap issues in profile creation and list screens - Add proper edge-to-edge handling with dynamic padding for navigation bars - Improve paired device selection with "None" option and clear functionality - Add localized error messages for key validation with proper placeholders - Centralize default signal quality value in DeviceProfile companion object - Add unsaved changes detection and confirmation dialogs - Enhance drag handle touch target size with FrameLayout wrapper - Restore device address in profile editing and improve change tracking - Localize all user-facing strings following project guidelines
This commit adds a TODO comment to `GeneralSettings.kt` to migrate settings related to signal quality and main device details to the new device profiles system.
Removed the deviceModel property from ApplePodsFactory interface and all 25 implementing classes across AirPods, Beats, and misc device factories. This simplifies the factory pattern as the model information can be derived from the concrete implementation type itself.
This commit enables the automatic generation of per-app language preferences by configuring the Android Gradle Plugin. A `resources.properties` file is added to specify `en` as the `unqualifiedResLocale`, which serves as the default/fallback locale. Additionally, `.kotlin` is added to `.gitignore` to exclude Kotlin build-related files.
This commit modifies the `AppleFactory` to correctly handle `PodDevice.Model.UNKNOWN`. Previously, if a device's model was `UNKNOWN`, it wouldn't match any profile and `isIRKMatch` would be false. This change ensures that `isIRKMatch` reflects the actual IRK match status, regardless of whether a specific profile is found. Devices with an `UNKNOWN` model can now match profiles that are also marked as `UNKNOWN`, allowing for generic profile matching when the specific model isn't identified.
This commit introduces a new device profile system, moving away from a single "main device" configuration in `GeneralSettings`. Key changes: - `DeviceProfilesRepo` now manages a list of `DeviceProfile` objects, allowing for multiple device configurations. - On first launch with this update, existing "main device" settings from `GeneralSettings` (address, model, keys, signal quality) are migrated into a new default `AppleDeviceProfile`. - The `MonitorWorker`, `PopUpReaction`, `AutoConnect`, and `PodHistoryRepo` have been updated to use the new `DeviceProfilesRepo` instead of the old `GeneralSettings` for device-specific information. - `AppleFactory` now uses `DeviceProfilesRepo` to find matching profiles based on IRK. - `TroubleShooterFragmentVM` now interacts with `DeviceProfilesRepo` for profile management during troubleshooting. - The `create` method in `ApplePodsFactory` and its implementations are now `suspend` functions to allow for asynchronous operations like fetching profiles from the repository. - Old "main device" preference keys in `GeneralSettings` have been renamed with an "old" prefix and will be removed in a future update. - A new `currentProfiles()` extension function provides a convenient way to get the current list of profiles.
The signal quality slider in `device_profile_creation_fragment.xml` now ranges from 0 to 100 with a step size of 1, previously 10 to 100 with a step size of 5.
- Shows hint when 2+ profiles exist explaining order determines priority - Appears as flat list item at bottom, less intrusive than card - Prevents dragging hint item, keeps it at bottom - Uses book icon for informational guidance
- Replace multiple StateFlows with single ProfileEditorState data class - Store ByteArray keys as hex strings to enable proper equality comparison - Fix race conditions in state initialization by setting initial and current state atomically - Simplify change detection logic to simple data class comparison The issue was caused by: 1. ByteArray types not implementing proper equals() (compared by reference) 2. Race conditions between multiple StateFlow updates 3. Complex change detection logic with timing issues Now uses atomic state management with proper value-based equality.
Member
Author
This commit introduces a new card to the Overview screen that informs the user that the app is actively monitoring for devices when there are profiles configured but no devices are currently connected.
This commit replaces the direct usage of GeneralSettings for fetching identity and encryption keys with the DeviceProfilesRepo. BaseAirPodsTest is updated to reflect this change, mocking DeviceProfilesRepo instead of GeneralSettings.
The lid state for AirPods Gen 4 was incorrectly reported as UNKNOWN when it should have been NOT_IN_CASE. This commit fixes the issue in both the ANC and non-ANC tests.
Refactor: Simplify signal quality filter.
The navigation graph had a duplicate entry for DeviceManagerFragment. This commit removes the duplicate and ensures the correct navigation action to DeviceProfileCreationFragment is present.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For users that have more than one AirPod device.
This also refactors the module structure back to a single module. The previous split to a
coremodule, to support awearmodule was taking its toll. Since the wear app was abandoned (Google overhead), I vowed to remove it once it got significantly in the way (which was now).