diff options
| author | jiabin <jiabin@google.com> | 2020-07-31 11:05:01 -0700 |
|---|---|---|
| committer | jiabin <jiabin@google.com> | 2020-07-31 15:41:38 -0700 |
| commit | bacecee90b63c582538db65573335208187c2097 (patch) | |
| tree | 72c717a61fc621b825b324c79ebc4961d10160a5 /core/java/android/bluetooth/BluetoothDevice.java | |
| parent | 0a7fd66f109a15664cb61bcf9682cbdfae8957ee (diff) | |
Do not log sensitive information in AudioService.
Sensitive information, such as IP and MAC address, should not be logged.
In AudioService, only log the last 3 octets of BT device address.
Test: make, connect BT device and log
Bug: 162299985
Change-Id: I99db812efc327e6f3ebe791274998291a140a5b6
Diffstat (limited to 'core/java/android/bluetooth/BluetoothDevice.java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothDevice.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index fb9746830d4e..548bca485681 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -1033,6 +1033,18 @@ public final class BluetoothDevice implements Parcelable { } /** + * Returns the anonymized hardware address of this BluetoothDevice. The first three octets + * will be suppressed for anonymization. + * <p> For example, "XX:XX:XX:AA:BB:CC". + * + * @return Anonymized bluetooth hardware address as string + * @hide + */ + public String getAnonymizedAddress() { + return "XX:XX:XX" + getAddress().substring(8); + } + + /** * Get the friendly Bluetooth name of the remote device. * * <p>The local adapter will automatically retrieve remote names when |
