diff options
| author | 2025-02-26 09:20:36 -0800 | |
|---|---|---|
| committer | 2025-02-26 09:20:36 -0800 | |
| commit | ec394f44abda88dc371bf814512c8ea092dcd1ad (patch) | |
| tree | 8992f76ce4c332e9250e6b57332acd9f0cd7ee3b /framework/java | |
| parent | 8273c12ff1dbf433cdfe31a74d9c1b1bdb1f4361 (diff) | |
| parent | 34b915c9fa7fa1009db8ceee7a7f00d750052167 (diff) | |
Merge changes Ic24bc34a,I6ec8c492 into main am: 8ce7a52661 am: 34b915c9fa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3503361
Change-Id: Ia2c8007e3050fdd13f02bd1a9621593d3bcf51c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'framework/java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothDevice.java | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java index 0c3f4288e6..8c053201e9 100644 --- a/framework/java/android/bluetooth/BluetoothDevice.java +++ b/framework/java/android/bluetooth/BluetoothDevice.java @@ -896,8 +896,7 @@ public final class BluetoothDevice implements Parcelable, Attributable { * * @hide */ - @SystemApi - public static final int METADATA_EXCLUSIVE_MANAGER = 29; + @SystemApi public static final int METADATA_EXCLUSIVE_MANAGER = 29; private static final int METADATA_MAX_KEY = METADATA_EXCLUSIVE_MANAGER; @@ -1727,8 +1726,8 @@ public final class BluetoothDevice implements Parcelable, Attributable { /** * Returns the identity address and identity address type of this BluetoothDevice. An identity - * address is a public or static random Bluetooth LE device address that serves as a - * unique identifier. + * address is a public or static random Bluetooth LE device address that serves as a unique + * identifier. * * @return a {@link BluetoothAddress} containing identity address and identity address type. If * Bluetooth is not enabled or identity address type is not available, it will return a @@ -3791,6 +3790,31 @@ public final class BluetoothDevice implements Parcelable, Attributable { return true; } + /** + * Get the number of times {@link ACTION_KEY_MISSING} intent is thrown for this device since + * last successful encrypted connection + * + * @return number of times {@link ACTION_KEY_MISSING} intent is thrown for this device since + * last successful encrypted connection + * + * @hide + */ + @RequiresPermission(BLUETOOTH_CONNECT) + public int getKeyMissingCount() { + final IBluetooth service = getService(); + if (service == null || !isBluetoothEnabled()) { + Log.e(TAG, "Bluetooth is not enabled. Cannot get key missing counter."); + if (DBG) log(Log.getStackTraceString(new Throwable())); + } else { + try { + return service.getKeyMissingCount(this, mAttributionSource); + } catch (RemoteException e) { + Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); + } + } + return -1; + } + private static void log(String msg) { Log.d(TAG, msg); } |