Grant Bluetooth runtime permissions for MultipeerReplicator on Android#421
Merged
Conversation
* Declare permissions required for Bluetooth in AndroidManifest.xml * AndroidBridge.install: run "adb pm grant" for the dangerous runtime permissions after install so the test server never blocks on a system permission dialog. Noted that this step is only required for MultipeerReplicator testing with bluetooth. When running the test manually on your local device (not via Jenkins pipeline, this step is also required. Here are the sample commands : ``` adb shell pm grant com.couchbase.lite.android.mobiletest android.permission.BLUETOOTH_SCAN adb shell pm grant com.couchbase.lite.android.mobiletest android.permission.BLUETOOTH_CONNECT adb shell pm grant com.couchbase.lite.android.mobiletest android.permission.BLUETOOTH_ADVERTISE adb shell pm grant com.couchbase.lite.android.mobiletest android.permission.ACCESS_FINE_LOCATION ``` - Fix missing semicolon on the EnumSet import in MultipeerReplicatorManager
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Android JAK test server harness to ensure MultipeerReplicator Bluetooth transport can run unattended (e.g., in CI) by declaring the required Bluetooth permissions and pre-granting dangerous runtime permissions after installation, avoiding blocking system permission dialogs.
Changes:
- Declare Bluetooth-related permissions in the AndroidManifest for both API ≤ 30 and API 31+.
- Add a fail-fast permission sanity check before starting a MultipeerReplicator, with explicit
adb pm grantcommands in the error message. - Update the AWS Android bridge to grant relevant runtime permissions immediately after APK install; also fixes a missing
EnumSetimport semicolon.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| servers/jak/android/app/src/main/java/com/couchbase/lite/android/mobiletest/services/MultipeerReplicatorService.java | Adds a pre-start missing-permissions check that fails fast with actionable adb pm grant guidance. |
| servers/jak/android/app/src/main/java/com/couchbase/lite/android/mobiletest/endpoints/v1/MultipeerReplicatorManager.java | Fixes EnumSet import syntax (missing semicolon). |
| servers/jak/android/app/src/main/java/com/couchbase/lite/android/mobiletest/AndroidTestApp.kt | Exposes Android Context via getContext() for permission checks. |
| servers/jak/android/app/src/main/AndroidManifest.xml | Declares Bluetooth permissions for MultipeerReplicator across Android API levels. |
| environment/aws/topology_setup/test_server_platforms/android_bridge.py | Grants MultipeerReplicator-related dangerous permissions post-install via adb. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
borrrden
approved these changes
Jun 4, 2026
barkha06
approved these changes
Jun 8, 2026
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.
Declare permissions required for Bluetooth in AndroidManifest.xml
AndroidBridge.install: run "adb pm grant" for the dangerous runtime permissions after install so the test server never blocks on a system permission dialog. Noted that this step is only required for MultipeerReplicator testing with bluetooth. When running the test manually on your local device (not via Jenkins pipeline, this step is also required. Here are the sample commands :
Fix missing semicolon on the EnumSet import in MultipeerReplicatorManager