Skip to content

Bonjour#120

Merged
sameerasw merged 6 commits into
developfrom
bonjour
Jun 10, 2026
Merged

Bonjour#120
sameerasw merged 6 commits into
developfrom
bonjour

Conversation

@sameerasw

Copy link
Copy Markdown
Owner

This pull request refactors device connection logic and improves device discovery handling in the AirSync app. The main focus is on making device connections more robust and context-aware, ensuring the correct device information and credentials are used, and replacing the legacy UDP discovery manager with a new orchestrator for device discovery. Additionally, it introduces UI enhancements for device source labeling and fixes some context usage issues.

Device connection and discovery improvements:

  • Refactored the connect function in AirSyncMainScreen.kt to accept explicit parameters (ipAddress, port, symmetricKey), ensuring the correct values are used for each connection attempt. This change also updates all call sites to pass the appropriate device information. [1] [2] [3] [4]
  • Added logic to retrieve and use the correct symmetric key for each device, including a new getSymmetricKeyForDevice method in AirSyncViewModel. [1] [2]
  • Improved state management in AirSyncViewModel to ensure the UI always displays the correct last connected device and IP address, both on initialization and when the connection state changes. [1] [2]

Device discovery orchestration:

  • Replaced all uses of UDPDiscoveryManager with the new DiscoveryOrchestrator in both the service and viewmodel, centralizing device discovery logic. [1] [2] [3] [4] [5]

User interface enhancements:

  • Added a visual label ("mDNS" or "UDP") to each discovered device in the device list, making it clear which discovery method was used. The label is color-coded and styled for clarity.

Context and resource management:

  • Updated the registration of the power save receiver to use the application context, preventing potential memory leaks from holding onto an Activity context.

Imports and code organization:

  • Added and reorganized imports to support the new features and refactoring, such as importing DiscoverySource, RoundedCornerShape, and DiscoveryOrchestrator. [1] [2]

These changes collectively improve the reliability and clarity of device connections and discovery in the app, while also enhancing the user experience with better device information and safer resource handling.

@sameerasw sameerasw self-assigned this Jun 10, 2026
@sameerasw sameerasw added the enhancement New feature or request label Jun 10, 2026
@sameerasw sameerasw merged commit ff235f2 into develop Jun 10, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in AirSync Features and Bugs Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant