Loading android/app/OWNERS +2 −1 Original line number Diff line number Diff line Loading @@ -10,4 +10,5 @@ qasimj@google.com rahulsabnis@google.com sattiraju@google.com siyuanh@google.com wescande@google.com zachoverflow@google.com android/app/src/com/android/bluetooth/btservice/storage/DatabaseManager.java +13 −11 Original line number Diff line number Diff line Loading @@ -370,15 +370,16 @@ public class DatabaseManager { String address = device.getAddress(); if (!mMetadataCache.containsKey(address)) { Log.d(TAG, "getProfileConnectionPolicy: device xx:xx:xx:xx:xx:xx is not in cache"); Log.d(TAG, "getProfileConnectionPolicy: device " + device.getAnonymizedAddress() + " is not in cache"); return BluetoothProfile.CONNECTION_POLICY_UNKNOWN; } Metadata data = mMetadataCache.get(address); int connectionPolicy = data.getProfileConnectionPolicy(profile); Log.v(TAG, "getProfileConnectionPolicy: xx:xx:xx:xx:xx:xx, profile=" + BluetoothProfile.getProfileName(profile) Log.v(TAG, "getProfileConnectionPolicy: device " + device.getAnonymizedAddress() + " profile=" + BluetoothProfile.getProfileName(profile) + ", connectionPolicy=" + connectionPolicy); return connectionPolicy; } Loading Loading @@ -533,7 +534,8 @@ public class DatabaseManager { */ public void setConnection(BluetoothDevice device, boolean isA2dpDevice) { synchronized (mMetadataCache) { Log.d(TAG, "setConnection: device=xx:xx:xx:xx:xx:xx and isA2dpDevice=" + isA2dpDevice); Log.d(TAG, "setConnection: device " + device.getAnonymizedAddress() + " and isA2dpDevice=" + isA2dpDevice); if (device == null) { Log.e(TAG, "setConnection: device is null"); return; Loading @@ -559,8 +561,8 @@ public class DatabaseManager { metadata.is_active_a2dp_device = true; } Log.d(TAG, "Updating last connected time for device: xx:xx:xx:xx:xx:xx to " + metadata.last_active_time); Log.d(TAG, "Updating last connected time for device: " + device.getAnonymizedAddress() + " to " + metadata.last_active_time); updateDatabase(metadata); } } Loading Loading @@ -670,8 +672,8 @@ public class DatabaseManager { Metadata metadata = metadataList.get(index); if (metadata.last_active_time != MetadataDatabase.sCurrentConnectionNumber) { Log.d(TAG, "compactLastConnectionTime: Setting last_active_item for device: " + "xx:xx:xx:xx:xx:xx from " + metadata.last_active_time + " to " + MetadataDatabase.sCurrentConnectionNumber); + metadata.getAnonymizedAddress() + " from " + metadata.last_active_time + " to " + MetadataDatabase.sCurrentConnectionNumber); metadata.last_active_time = MetadataDatabase.sCurrentConnectionNumber; updateDatabase(metadata); MetadataDatabase.sCurrentConnectionNumber++; Loading Loading @@ -793,7 +795,7 @@ public class DatabaseManager { mMigratedFromSettingsGlobal = true; for (Metadata data : list) { String address = data.getAddress(); Log.v(TAG, "cacheMetadata: found device xx:xx:xx:xx:xx:xx"); Log.v(TAG, "cacheMetadata: found device " + data.getAnonymizedAddress()); mMetadataCache.put(address, data); } Log.i(TAG, "cacheMetadata: Database is ready"); Loading Loading @@ -1000,7 +1002,7 @@ public class DatabaseManager { Log.e(TAG, "updateDatabase: address is null"); return; } Log.d(TAG, "updateDatabase xx:xx:xx:xx:xx:xx"); Log.d(TAG, "updateDatabase " + data.getAnonymizedAddress()); Message message = mHandler.obtainMessage(MSG_UPDATE_DATABASE); message.obj = data; mHandler.sendMessage(message); Loading android/app/src/com/android/bluetooth/btservice/storage/Metadata.java +12 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,18 @@ class Metadata { return address; } /** * Returns the anonymized hardware address. 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 */ @NonNull public String getAnonymizedAddress() { return "XX:XX:XX" + getAddress().substring(8); } void setProfileConnectionPolicy(int profile, int connectionPolicy) { // We no longer support BluetoothProfile.PRIORITY_AUTO_CONNECT and are merging it into // BluetoothProfile.CONNECTION_POLICY_ALLOWED Loading apex/OWNERS 0 → 100644 +4 −0 Original line number Diff line number Diff line rahulsabnis@google.com wescande@google.com framework/OWNERS +1 −0 Original line number Diff line number Diff line Loading @@ -3,4 +3,5 @@ rahulsabnis@google.com sattiraju@google.com siyuanh@google.com wescande@google.com zachoverflow@google.com Loading
android/app/OWNERS +2 −1 Original line number Diff line number Diff line Loading @@ -10,4 +10,5 @@ qasimj@google.com rahulsabnis@google.com sattiraju@google.com siyuanh@google.com wescande@google.com zachoverflow@google.com
android/app/src/com/android/bluetooth/btservice/storage/DatabaseManager.java +13 −11 Original line number Diff line number Diff line Loading @@ -370,15 +370,16 @@ public class DatabaseManager { String address = device.getAddress(); if (!mMetadataCache.containsKey(address)) { Log.d(TAG, "getProfileConnectionPolicy: device xx:xx:xx:xx:xx:xx is not in cache"); Log.d(TAG, "getProfileConnectionPolicy: device " + device.getAnonymizedAddress() + " is not in cache"); return BluetoothProfile.CONNECTION_POLICY_UNKNOWN; } Metadata data = mMetadataCache.get(address); int connectionPolicy = data.getProfileConnectionPolicy(profile); Log.v(TAG, "getProfileConnectionPolicy: xx:xx:xx:xx:xx:xx, profile=" + BluetoothProfile.getProfileName(profile) Log.v(TAG, "getProfileConnectionPolicy: device " + device.getAnonymizedAddress() + " profile=" + BluetoothProfile.getProfileName(profile) + ", connectionPolicy=" + connectionPolicy); return connectionPolicy; } Loading Loading @@ -533,7 +534,8 @@ public class DatabaseManager { */ public void setConnection(BluetoothDevice device, boolean isA2dpDevice) { synchronized (mMetadataCache) { Log.d(TAG, "setConnection: device=xx:xx:xx:xx:xx:xx and isA2dpDevice=" + isA2dpDevice); Log.d(TAG, "setConnection: device " + device.getAnonymizedAddress() + " and isA2dpDevice=" + isA2dpDevice); if (device == null) { Log.e(TAG, "setConnection: device is null"); return; Loading @@ -559,8 +561,8 @@ public class DatabaseManager { metadata.is_active_a2dp_device = true; } Log.d(TAG, "Updating last connected time for device: xx:xx:xx:xx:xx:xx to " + metadata.last_active_time); Log.d(TAG, "Updating last connected time for device: " + device.getAnonymizedAddress() + " to " + metadata.last_active_time); updateDatabase(metadata); } } Loading Loading @@ -670,8 +672,8 @@ public class DatabaseManager { Metadata metadata = metadataList.get(index); if (metadata.last_active_time != MetadataDatabase.sCurrentConnectionNumber) { Log.d(TAG, "compactLastConnectionTime: Setting last_active_item for device: " + "xx:xx:xx:xx:xx:xx from " + metadata.last_active_time + " to " + MetadataDatabase.sCurrentConnectionNumber); + metadata.getAnonymizedAddress() + " from " + metadata.last_active_time + " to " + MetadataDatabase.sCurrentConnectionNumber); metadata.last_active_time = MetadataDatabase.sCurrentConnectionNumber; updateDatabase(metadata); MetadataDatabase.sCurrentConnectionNumber++; Loading Loading @@ -793,7 +795,7 @@ public class DatabaseManager { mMigratedFromSettingsGlobal = true; for (Metadata data : list) { String address = data.getAddress(); Log.v(TAG, "cacheMetadata: found device xx:xx:xx:xx:xx:xx"); Log.v(TAG, "cacheMetadata: found device " + data.getAnonymizedAddress()); mMetadataCache.put(address, data); } Log.i(TAG, "cacheMetadata: Database is ready"); Loading Loading @@ -1000,7 +1002,7 @@ public class DatabaseManager { Log.e(TAG, "updateDatabase: address is null"); return; } Log.d(TAG, "updateDatabase xx:xx:xx:xx:xx:xx"); Log.d(TAG, "updateDatabase " + data.getAnonymizedAddress()); Message message = mHandler.obtainMessage(MSG_UPDATE_DATABASE); message.obj = data; mHandler.sendMessage(message); Loading
android/app/src/com/android/bluetooth/btservice/storage/Metadata.java +12 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,18 @@ class Metadata { return address; } /** * Returns the anonymized hardware address. 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 */ @NonNull public String getAnonymizedAddress() { return "XX:XX:XX" + getAddress().substring(8); } void setProfileConnectionPolicy(int profile, int connectionPolicy) { // We no longer support BluetoothProfile.PRIORITY_AUTO_CONNECT and are merging it into // BluetoothProfile.CONNECTION_POLICY_ALLOWED Loading
apex/OWNERS 0 → 100644 +4 −0 Original line number Diff line number Diff line rahulsabnis@google.com wescande@google.com
framework/OWNERS +1 −0 Original line number Diff line number Diff line Loading @@ -3,4 +3,5 @@ rahulsabnis@google.com sattiraju@google.com siyuanh@google.com wescande@google.com zachoverflow@google.com