SecurityException when requesting Bluetooth discoverability
- Android version: 12
- Phone model: Nubia NX679J (NX679J-UN)
- Briar version: 1.4.22 (f02bbebf)
- User feedback: "Attempting to add contact."
Stacktrace:
java.lang.SecurityException: Permission Denial: starting Intent { act=android.bluetooth.adapter.action.REQUEST_DISCOVERABLE cmp=com.android.settings/.bluetooth.RequestPermissionActivity (has extras) } from ProcessRecord{708319 15100:org.b
riarproject.briar.android/u0a226} (pid=15100, uid=10226) requires android.permission.BLUETOOTH
at android.os.Parcel.createExceptionOrNull(Parcel.java:2426)
at android.os.Parcel.createException(Parcel.java:2410)
at android.os.Parcel.readException(Parcel.java:2393)
at android.os.Parcel.readException(Parcel.java:2335)
at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2559)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:2071)
at android.app.Activity.startActivityForResult(Activity.java:5574)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:574)
at androidx.core.app.ActivityCompat.startActivityForResult(ActivityCompat.java:234)
at androidx.activity.ComponentActivity$2.onLaunch(ComponentActivity.java:208)
at androidx.activity.result.ActivityResultRegistry$2.launch(ActivityResultRegistry.java:166)
at androidx.activity.result.ActivityResultLauncher.launch(ActivityResultLauncher.java:47)
at org.briarproject.briar.android.contact.add.nearby.AddNearbyContactActivity.requestBluetoothDiscoverable(AddNearbyContactActivity.java:125)
at org.briarproject.briar.android.contact.add.nearby.AddNearbyContactActivity.lambda$onCreate$0(AddNearbyContactActivity.java:78)
at org.briarproject.briar.android.contact.add.nearby.AddNearbyContactActivity.$r8$lambda$AaDmrglLROf2UvjD046fjtdaWVs(Unknown Source:0)
at org.briarproject.briar.android.contact.add.nearby.AddNearbyContactActivity$$ExternalSyntheticLambda2.onEvent(Unknown Source:4)
at org.briarproject.briar.android.viewmodel.LiveEvent$LiveEventObserver.onChanged(LiveEvent.java:84)
at org.briarproject.briar.android.viewmodel.LiveEvent$LiveEventObserver.onChanged(LiveEvent.java:70)
at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
at org.briarproject.briar.android.viewmodel.MutableLiveEvent.setEvent(MutableLiveEvent.java:29)
at org.briarproject.briar.android.contact.add.nearby.AddNearbyContactViewModel.showQrCodeFragmentIfAllowed(AddNearbyContactViewModel.java:410)
at org.briarproject.briar.android.contact.add.nearby.AddNearbyContactIntroFragment.lambda$new$0(AddNearbyContactIntroFragment.java:38)
at org.briarproject.briar.android.contact.add.nearby.AddNearbyContactIntroFragment.$r8$lambda$O-WIAJRYMQrkvddeOqSFkFHjtQ0(Unknown Source:0)
at org.briarproject.briar.android.contact.add.nearby.AddNearbyContactIntroFragment$$ExternalSyntheticLambda1.onActivityResult(Unknown Source:4)
at androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.java:367)
at androidx.activity.ComponentActivity$2$1.run(ComponentActivity.java:159)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:242)
at android.os.Looper.loop(Looper.java:374)
at android.app.ActivityThread.main(ActivityThread.java:9333)
at java.lang.reflect.Method.invoke(Native Method)
Last line of log:
03-03 00:28:17.358 I/AddNearbyContactActivity: Asking for Bluetooth discoverability
Looks like another manufacturer that didn't completely remove the old Bluetooth permission checks when migrating to the new Android 12 permissions.