Merged
Conversation
- Integrated the Detekt plugin into the root and app-level `build.gradle.kts` files. - Added a new `detekt.yml` configuration file with customized rules for complexity, coroutines, style, and potential bugs. - Included `io.nlopez.compose.rules:detekt` as a Detekt plugin to enforce Jetpack Compose best practices. - Updated `gradle/libs.versions.toml` with version definitions for Detekt (1.23.8) and Compose rules (0.5.6). These changes introduce static code analysis to the project, ensuring better code quality and consistency with a specific focus on Kotlin Coroutines and Jetpack Compose standards.
…ion status - Introduced `BatteryOptimizationDialog` and `BatteryOptimizationWarning` for managing battery optimization settings. - Added `ConnectionStatusIcon` and related animated components to visually represent device connection states. - Created `DeviceCard` for displaying device information and connection status with expandable details. - Implemented `DevicesList` and `UnpairConfirmationDialog` for managing lists of paired devices and unpairing actions. - Added `LocationCard` for displaying GPS location with a map interface. These changes enhance the user experience by providing clear visual feedback on device status and managing battery optimization settings effectively.
… camera synchronization - Introduced `DeviceNameProvider` interface and its Android implementation `AndroidDeviceNameProvider` to resolve the phone's name using a prioritized fallback logic (Bluetooth name, Global settings, System settings, or Build model). - Added `getPairedDeviceName` to the `CameraVendor` interface, allowing vendors to customize how the phone's name is formatted when sent to a camera. - Overrode `getPairedDeviceName` in `RicohCameraVendor` to append a "(CameraSync)" suffix. - Updated `MultiDeviceSyncCoordinator` to utilize `DeviceNameProvider` instead of directly accessing `Build.MODEL`. - Enhanced dependency injection in `AppGraph` to provide the new name provider. - Added comprehensive unit tests and fakes for `DeviceNameProvider` and updated existing tests to reflect constructor changes in the coordinator. These changes centralize device naming logic, improve testability, and allow for vendor-specific naming conventions when pairing with cameras.
…ure and vendor support - Updated `MULTI_DEVICE_ARCHITECTURE.md` to include new fields in `PairedDeviceProto` for tracking sync status and firmware versions. - Refined `LocationCollectionCoordinator` documentation to clarify that update intervals are managed by `LocationRepository`. - Corrected dependency injection references from `AppGraphFactory` to `AppGraph.Factory`. - Updated `MULTI_VENDOR_SUPPORT.md` to reflect the migration of vendor registration from `CameraSyncApp.kt` to the `AppGraph` dependency injection module. - Fixed broken links and updated command descriptions in `README.md`. These changes ensure the documentation accurately reflects the current state of the codebase's architecture and configuration patterns.
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Show resolved
Hide resolved
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Show resolved
Hide resolved
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Show resolved
Hide resolved
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Show resolved
Hide resolved
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Show resolved
Hide resolved
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/dev/sebastiano/camerasync/devices/ConnectionStatusComponents.kt
Show resolved
Hide resolved
d38c61f to
353b250
Compare
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Show resolved
Hide resolved
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Show resolved
Hide resolved
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Show resolved
Hide resolved
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/DeviceConnectionManager.kt
Outdated
Show resolved
Hide resolved
4fb2de4 to
1323867
Compare
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Outdated
Show resolved
Hide resolved
| import dev.zacsweers.metro.Inject | ||
| import kotlinx.coroutines.Job | ||
|
|
||
| private const val TAG = "DeviceConnectionManager" |
1323867 to
b10c8d0
Compare
b10c8d0 to
9889e11
Compare
9889e11 to
5978fd1
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
app/src/main/kotlin/dev/sebastiano/camerasync/devicesync/MultiDeviceSyncCoordinator.kt
Show resolved
Hide resolved
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
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.


Clean up all the code, in multiple passes, to improve both coherency and readability. Update the docs, add Detekt for static analysis (with Compose rules). Improve the device name submission to Ricoh cameras.
Note
Medium Risk
Touches core sync orchestration and connection lifecycle code, so regressions could impact background reconnection, firmware notifications, or location syncing despite being largely a cleanup/refactor.
Overview
Adds Detekt (including Compose rules) to the Android app build and updates README links/task docs.
Refactors the devices list screen by extracting large chunks of Compose UI into focused components (device cards, connection status, battery optimization warnings/dialog, list/empty/loading states, and map
LocationCard) without changing the screen’s overall behavior.Reworks
MultiDeviceSyncCoordinatorinto smaller responsibilities: introducesDeviceConnectionManagerto track connections/jobs andDeviceFirmwareManagerto encapsulate firmware-update notification logic, switches the coordinator to assisted injection, tightens connection/disconnect/periodic-retry flow, and adjusts device-name submission to use vendor-provided naming viaDeviceNameProvider.Hardens background/service and BLE scan operations by avoiding
GlobalScope, improving WorkManager warning logging, and narrowing exception handling in scan/service start paths and BLE scan/pairing operations (e.g.,SecurityException/IllegalStateException/IOException).Written by Cursor Bugbot for commit f00ad4d. This will update automatically on new commits. Configure here.