Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit acf3b8dc authored by Duo Ho's avatar Duo Ho
Browse files

[Avatar] Clear GattInstance in FactoryReset

Test: avatar run --mobly-std-log --include-filter 'ASHATest'
Bug: 279599889
Change-Id: I843629a524eea7e687437048cd1974e2edc9cb35
parent 0a912f16
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ class Gatt(private val context: Context) : GATTImplBase(), Closeable {
  override fun close() {
    serverManager.server.close()
    mScope.cancel()
    // Clear existing Gatt instances to fix flakiness: b/279599889
    GattInstance.clearAllInstances()
  }

  override fun exchangeMTU(
+3 −0
Original line number Diff line number Diff line
@@ -73,6 +73,9 @@ class GattInstance(val mDevice: BluetoothDevice, val mTransport: Int, val mConte
      requireNotNull(instance) { "Unable to find GATT instance for $address" }
      return instance
    }
    fun clearAllInstances() {
        gattInstances.clear()
    }
  }

  private val mCallback =