Fix requestConnectionPriority implementation#2
Merged
aqeel-bmec-co merged 1 commit intomainfrom Mar 30, 2026
Merged
Conversation
- Remove redundant BleCapabilities guard in Dart layer (native handles it) - Add BleConnectionPriority Kotlin enum mirroring Dart enum - Map to explicit Android SDK constants via when expression - Add firstOrNull with ILLEGAL_ARGUMENT for unknown priority values - Add catch (e: Exception) block for broader error handling - Fix enum doc comment (throws belongs on method, not enum) - Remove stale capability check guidance from docs and README
Collaborator
Author
|
🤖 PR Review: #2 Fix requestConnectionPriority implementation Risk: 4/9 — 🟠 Yellow
Reviewer: @raphael-bmec-co — PR author of the original Review Focus
Changed Files
|
Collaborator
Author
|
@raphael-bmec-co These changes do affect how the Enum is handled as well as converted. Thus I think we should review/test them |
|
Please update the test up to test as discussed. |
Collaborator
Author
|
@raphael-bmec-co The test app connects and is able to set the priority. Merging |
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.
🤖 Addresses review comments on Navideck#221
Features/Fixes
BleCapabilities.supportsConnectionPriorityApiguard in Dart layer — native implementations already returnnotSupported, consistent withreadRssipattern.BleConnectionPriorityKotlin enum inUniversalBleHelper.ktmirroring the Dart enum, following the same pattern asBleInputPropertyandBleOutputProperty.whenmapping to Android SDK constants (BluetoothGatt.CONNECTION_PRIORITY_*) rather than relying on coincidental index equality.firstOrNullwithILLEGAL_ARGUMENTearly return for unknown priority values.catch (e: Exception)block to handleSecurityExceptionand other runtime exceptions, consistent withsetNotifiable,readValue, andpair.@throwsbelonged on the calling method, not the enum declaration.BleCapabilities.supportsConnectionPriorityApibefore calling" guidance from API doc and README.