commit | 0dcecbd321b2d79e351b0d46136316e5b04574ab | [log] [tgz] |
---|---|---|
author | Etienne Ruffieux <eruffieux@google.com> | Mon Aug 01 17:04:23 2022 -0700 |
committer | Charlie Boutier <charliebout@google.com> | Thu Aug 11 23:14:32 2022 +0000 |
tree | 6f330e6074c2c022faf3af65ff4599f7276165d8 | |
parent | f9b1b5af9ca78eaa0273e4436400fdd82793ef91 [diff] |
Added list instance removal in GattInstance#disconnect() PTS is trying to connect a device that has not been fully disconnected, but won't accept that the grpc waits for the diconnection before returning. We have to remove the instance as soon as we call disconnect, but we also have to remove it when the disconnection comes from the device. Bug: 239103399 Bug: 241962982 Bug: 242184809 Tag: #feature Test: atest pts-bot Ignore-AOSP-First: Cherry-picked from AOSP Merged-In: I808f07d1434fa160ab057528e4e21313348505fe Change-Id: I808f07d1434fa160ab057528e4e21313348505fe
diff --git a/android/pandora/server/src/com/android/pandora/GattInstance.kt b/android/pandora/server/src/com/android/pandora/GattInstance.kt index 3db2411..953e373 100644 --- a/android/pandora/server/src/com/android/pandora/GattInstance.kt +++ b/android/pandora/server/src/com/android/pandora/GattInstance.kt
@@ -124,6 +124,7 @@ } mGatt.close() mGatt.disconnect() + gattInstances.remove(mDevice.address) } override fun toString(): String {