diff options
| author | Stanley Tng <stng@google.com> | 2017-04-17 22:35:45 -0700 |
|---|---|---|
| committer | Andre Eisenbach <eisenbach@google.com> | 2017-04-21 22:19:57 +0000 |
| commit | cf3818675f65d8c1901b3d33eab5db1cabb74ea7 (patch) | |
| tree | 275b5f968b983acf5e78a95b2569e9896b527d01 /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | f740d1eadc6ed3b0be2087e81f414b77d58effde (diff) | |
Allow the Bluetooth MAC address to be updated asynchronously (2/3)
There are intermittent issues where either the returned Bluetooth
MAC address to Java framework is uninitialized or this address update
arrives too late. This fix will do 2 things:
(1) Returns error when MAC address is unavailable in the native code.
(2) Updates the MAC address later by adding a new broadcast event.
Test: Check address for these cases: factory reset, system reboot, and
Bluetooth re-enable.
Bug: 36709382
Change-Id: I09720193e38fdf9139e1bb146f8e1847e2b65b1a
(cherry picked from commit ad4d1d8e28618546953e75d4983335631feb6f2a)
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 845a47d998..85636033d8 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -466,6 +466,30 @@ public final class BluetoothAdapter { "android.bluetooth.adapter.action.BLE_STATE_CHANGED"; /** + * Intent used to broadcast the change in the Bluetooth address + * of the local Bluetooth adapter. + * <p>Always contains the extra field {@link + * #EXTRA_BLUETOOTH_ADDRESS} containing the Bluetooth address. + * + * Note: only system level processes are allowed to send this + * defined broadcast. + * + * @hide + */ + public static final String ACTION_BLUETOOTH_ADDRESS_CHANGED = + "android.bluetooth.adapter.action.BLUETOOTH_ADDRESS_CHANGED"; + + /** + * Used as a String extra field in {@link + * #ACTION_BLUETOOTH_ADDRESS_CHANGED} intent to store the local + * Bluetooth address. + * + * @hide + */ + public static final String EXTRA_BLUETOOTH_ADDRESS = + "android.bluetooth.adapter.extra.BLUETOOTH_ADDRESS"; + + /** * Broadcast Action: The notifys Bluetooth ACL connected event. This will be * by BLE Always on enabled application to know the ACL_CONNECTED event * when Bluetooth state in STATE_BLE_ON. This denotes GATT connection |
