mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +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) {
|
if (bt == null) {
|
||||||
setBluetoothState(BluetoothState.NO_ADAPTER);
|
setBluetoothState(BluetoothState.NO_ADAPTER);
|
||||||
} else {
|
} else {
|
||||||
setBluetoothState(BluetoothState.WAITING);
|
|
||||||
wasAdapterEnabled = bt.isEnabled();
|
|
||||||
Intent i = new Intent(ACTION_REQUEST_DISCOVERABLE);
|
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