companion_device_manager 1.0.0
companion_device_manager: ^1.0.0 copied to clipboard
Android-only Flutter plugin for Companion Device Manager (CDM) association and wake callbacks
1.0.0 #
- Added Gradle 9 / Android Gradle Plugin 9.x compatibility: replaced the deprecated
kotlinOptions { jvmTarget = ... }block (now a hard compile error under Kotlin 2.4 / AGP 9.1) with thekotlin { compilerOptions { jvmTarget = ... } }DSL. - Verified the plugin builds and compiles cleanly as a subproject in a host app using Gradle 9.3.1 / AGP 9.1.0 / Kotlin 2.4.0.
- No public API changes; promoted to 1.0.0 as the first stable release.
0.2.5 #
- Fixed a crash on Android 11 devices by only calling
AssociationRequest.Builder.setDisplayName(...)on Android 13+ (API 33+). - Documented the API-level limitation for association display names in the public docs.
0.2.4 #
- Removed direct application of
org.jetbrains.kotlin.androidfrom the plugin's Android Gradle script. - Updated Android plugin build setup to align with Flutter's upcoming requirement that plugins must not apply KGP directly.
- Prevents future Flutter build failures related to plugin-level Kotlin Gradle Plugin usage.
0.2.3 #
- Added
REQUEST_COMPANION_RUN_IN_BACKGROUNDandREQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUNDpermissions for enhanced background operation support on Android 12+ devices. - Improved handling of background presence observation to ensure stable callback execution across device lifecycle events.
- Enhanced native debug logging for better troubleshooting of background callback and presence observation flows.
- Updated Android manifest with strict permission requirements for background operations.
0.2.2 #
- Breaking change:
registerBackgroundCallbacknow requires an informative callback signature:Future<void> Function(CompanionDeviceEvent event). - Breaking change:
CompanionDeviceEvent.typeis now a typed enum (CompanionDeviceEventType) instead ofString. - Added dispatcher-based background delivery bridge so headless callback execution receives the exact event payload from Android safely.
- Background callback payload now carries event type + association data (including MAC address) for direct business-logic handling.
- Updated example app and docs for enum-based event handling and the new callback signature.
0.2.1 #
- Added
CompanionDeviceManager.associateByMacAddress(String macAddress)convenience API for MAC-only association requests. - Added
CompanionDeviceManager.disassociateByMacAddress(String macAddress)convenience API for cross-session disassociation using only MAC address. - Added strict MAC format validation (
XX:XX:XX:XX:XX:XX) and uppercase normalization for the new convenience APIs. - Clarified Android API-level support in docs: association APIs require API 26+, while background presence/wake flows require API 31+ (with API 33+ id-based observation path).
0.2.0 #
- Added
CompanionDeviceManager.backgroundEventsfor reactivedevice_appeared/device_disappearedupdates. - Added Android
EventChannelsupport (companion_device_manager/events) and native event emission fromCompanionDeviceBackgroundService. - Fixed background stream attachment/detachment race condition: event sink now properly scoped per Flutter engine to avoid conflicts between foreground and headless engines.
- Fixed
SharedPreferencesrace condition on event persistence by switching from asyncapply()to synchronouscommit()for reliable "Reload last event" behavior. - Fixed
ServicesBindinginitialization error in headless background callback by ensuringWidgetsFlutterBinding.ensureInitialized()andui.DartPluginRegistrant.ensureInitialized()are called early in flow. - Removed duplicate plugin registration in headless Flutter engine to eliminate duplicate registration warnings.
- Updated the example app to:
- reactively refresh UI with background events from the stream
- auto-log new background events
- display formatted receive timestamp (date/time + relative "time ago" update)
- Updated README with background callback initialization requirements and example app usage.
0.1.0 #
- Implemented a real Android-only Companion Device Manager plugin API.
- Added typed Dart models for association requests, associations, filters, and events.
- Added method-channel support for availability checks, association, disassociation, and event retrieval.
- Added background callback registration for wake scenarios using
CompanionDeviceService. - Added Android native storage for callback handles and last background event payload.
- Reworked the example app to demonstrate the full association and wake callback flow.
- Added detailed documentation in
doc/and a pub.dev-style root README.
0.0.1 #
- Initial template generated by Flutter plugin scaffolding.