Loading android/app/src/com/android/bluetooth/gatt/GattService.java +7 −5 Original line number Original line Diff line number Diff line Loading @@ -241,12 +241,11 @@ public class GattService extends ProfileService { Log.w(TAG, "stop() called before start()"); Log.w(TAG, "stop() called before start()"); return; return; } } if (Flags.scanManagerRefactor()) { if (Flags.scanManagerRefactor()) { setGattService(null); setGattService(null); } } else { mTransitionalScanHelper.stop(); mTransitionalScanHelper.stop(); } mAdvertiserMap.clear(); mAdvertiserMap.clear(); mClientMap.clear(); mClientMap.clear(); if (Flags.gattCleanupRestrictedHandles()) { if (Flags.gattCleanupRestrictedHandles()) { Loading @@ -271,8 +270,10 @@ public class GattService extends ProfileService { if (mDistanceMeasurementManager != null) { if (mDistanceMeasurementManager != null) { mDistanceMeasurementManager.cleanup(); mDistanceMeasurementManager.cleanup(); } } if (!Flags.scanManagerRefactor()) { mTransitionalScanHelper.cleanup(); mTransitionalScanHelper.cleanup(); } } } /** This is only used when Flags.scanManagerRefactor() is true. */ /** This is only used when Flags.scanManagerRefactor() is true. */ public static synchronized GattService getGattService() { public static synchronized GattService getGattService() { Loading Loading @@ -306,7 +307,8 @@ public class GattService extends ProfileService { new Handler(getMainLooper()) { new Handler(getMainLooper()) { public void handleMessage(Message msg) { public void handleMessage(Message msg) { synchronized (mTestModeLock) { synchronized (mTestModeLock) { if (!GattService.this.isTestModeEnabled()) { if (!GattService.this.isTestModeEnabled() || Flags.scanManagerRefactor()) { return; return; } } for (String test : TEST_MODE_BEACONS) { for (String test : TEST_MODE_BEACONS) { Loading flags/gap.aconfig +10 −0 Original line number Original line Diff line number Diff line Loading @@ -209,3 +209,13 @@ flag { description: "Allocate GATT clients in heap to unlimit the number of clients" description: "Allocate GATT clients in heap to unlimit the number of clients" bug: "348559823" bug: "348559823" } } flag { name: "gatt_fix_multiple_direct_connect" namespace: "bluetooth" description: "Do not remove device when multiple clients attempt to connect" bug: "349232327" metadata { purpose: PURPOSE_BUGFIX } } system/bta/hearing_aid/hearing_aid.cc +2 −1 Original line number Original line Diff line number Diff line Loading @@ -1106,7 +1106,7 @@ class HearingAidImpl : public HearingAid { /// The L2CAP will automatically reconnect the LE-ACL link on /// The L2CAP will automatically reconnect the LE-ACL link on /// disconnection when there is a pending channel request, /// disconnection when there is a pending channel request, /// which invalidates all encryption checks performed here. /// which invalidates all encryption checks performed here. com::android::bluetooth::flags::asha_asrc() com::android::bluetooth::flags::asha_encrypted_l2c_coc() ? BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT ? BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT : BTM_SEC_NONE, : BTM_SEC_NONE, HearingAidImpl::GapCallbackStatic, BT_TRANSPORT_LE); HearingAidImpl::GapCallbackStatic, BT_TRANSPORT_LE); Loading Loading @@ -1953,6 +1953,7 @@ class HearingAidImpl : public HearingAid { audio_running = false; audio_running = false; encoder_state_release(); encoder_state_release(); current_volume = VOLUME_UNKNOWN; current_volume = VOLUME_UNKNOWN; ResetAsrc(); } } void SetVolume(int8_t volume) { void SetVolume(int8_t volume) { Loading Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +7 −5 Original line number Original line Diff line number Diff line Loading @@ -241,12 +241,11 @@ public class GattService extends ProfileService { Log.w(TAG, "stop() called before start()"); Log.w(TAG, "stop() called before start()"); return; return; } } if (Flags.scanManagerRefactor()) { if (Flags.scanManagerRefactor()) { setGattService(null); setGattService(null); } } else { mTransitionalScanHelper.stop(); mTransitionalScanHelper.stop(); } mAdvertiserMap.clear(); mAdvertiserMap.clear(); mClientMap.clear(); mClientMap.clear(); if (Flags.gattCleanupRestrictedHandles()) { if (Flags.gattCleanupRestrictedHandles()) { Loading @@ -271,8 +270,10 @@ public class GattService extends ProfileService { if (mDistanceMeasurementManager != null) { if (mDistanceMeasurementManager != null) { mDistanceMeasurementManager.cleanup(); mDistanceMeasurementManager.cleanup(); } } if (!Flags.scanManagerRefactor()) { mTransitionalScanHelper.cleanup(); mTransitionalScanHelper.cleanup(); } } } /** This is only used when Flags.scanManagerRefactor() is true. */ /** This is only used when Flags.scanManagerRefactor() is true. */ public static synchronized GattService getGattService() { public static synchronized GattService getGattService() { Loading Loading @@ -306,7 +307,8 @@ public class GattService extends ProfileService { new Handler(getMainLooper()) { new Handler(getMainLooper()) { public void handleMessage(Message msg) { public void handleMessage(Message msg) { synchronized (mTestModeLock) { synchronized (mTestModeLock) { if (!GattService.this.isTestModeEnabled()) { if (!GattService.this.isTestModeEnabled() || Flags.scanManagerRefactor()) { return; return; } } for (String test : TEST_MODE_BEACONS) { for (String test : TEST_MODE_BEACONS) { Loading
flags/gap.aconfig +10 −0 Original line number Original line Diff line number Diff line Loading @@ -209,3 +209,13 @@ flag { description: "Allocate GATT clients in heap to unlimit the number of clients" description: "Allocate GATT clients in heap to unlimit the number of clients" bug: "348559823" bug: "348559823" } } flag { name: "gatt_fix_multiple_direct_connect" namespace: "bluetooth" description: "Do not remove device when multiple clients attempt to connect" bug: "349232327" metadata { purpose: PURPOSE_BUGFIX } }
system/bta/hearing_aid/hearing_aid.cc +2 −1 Original line number Original line Diff line number Diff line Loading @@ -1106,7 +1106,7 @@ class HearingAidImpl : public HearingAid { /// The L2CAP will automatically reconnect the LE-ACL link on /// The L2CAP will automatically reconnect the LE-ACL link on /// disconnection when there is a pending channel request, /// disconnection when there is a pending channel request, /// which invalidates all encryption checks performed here. /// which invalidates all encryption checks performed here. com::android::bluetooth::flags::asha_asrc() com::android::bluetooth::flags::asha_encrypted_l2c_coc() ? BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT ? BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT : BTM_SEC_NONE, : BTM_SEC_NONE, HearingAidImpl::GapCallbackStatic, BT_TRANSPORT_LE); HearingAidImpl::GapCallbackStatic, BT_TRANSPORT_LE); Loading Loading @@ -1953,6 +1953,7 @@ class HearingAidImpl : public HearingAid { audio_running = false; audio_running = false; encoder_state_release(); encoder_state_release(); current_volume = VOLUME_UNKNOWN; current_volume = VOLUME_UNKNOWN; ResetAsrc(); } } void SetVolume(int8_t volume) { void SetVolume(int8_t volume) { Loading