mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
[android] check if REQUEST_BLUETOOTH_DISCOVERABLE is available before launching
This commit is contained in:
@@ -183,10 +183,14 @@ public abstract class KeyAgreementActivity extends BriarActivity implements
|
||||
if (bt == null) {
|
||||
setBluetoothState(BluetoothState.NO_ADAPTER);
|
||||
} else {
|
||||
setBluetoothState(BluetoothState.WAITING);
|
||||
wasAdapterEnabled = bt.isEnabled();
|
||||
Intent i = new Intent(ACTION_REQUEST_DISCOVERABLE);
|
||||
startActivityForResult(i, REQUEST_BLUETOOTH_DISCOVERABLE);
|
||||
if (i.resolveActivity(getPackageManager()) != null) {
|
||||
setBluetoothState(BluetoothState.WAITING);
|
||||
wasAdapterEnabled = bt.isEnabled();
|
||||
startActivityForResult(i, REQUEST_BLUETOOTH_DISCOVERABLE);
|
||||
} else {
|
||||
setBluetoothState(BluetoothState.NO_ADAPTER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user