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

Commit 8a8ed44f authored by Charlie Boutier's avatar Charlie Boutier
Browse files

PandoraServer: Disconnect all profiles in disconnectLE

Bug: 254077091
Test: atest avatar -- --tests="AshaTest#test_unbonding"
Change-Id: I2126f1276523ddf420477c09af48a784ccf4e611
parent 91f7e717
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -333,10 +333,6 @@ class Host(
        TRANSPORT_BREDR -> {
          Log.i(TAG, "disconnect BR_EDR")
          bluetoothDevice.disconnect()
          flow
            .filter { it.action == BluetoothDevice.ACTION_ACL_DISCONNECTED }
            .filter { it.getBluetoothDeviceExtra() == bluetoothDevice }
            .first()
        }
        TRANSPORT_LE -> {
          Log.i(TAG, "disconnect LE")
@@ -354,14 +350,18 @@ class Host(
            throw Status.UNKNOWN.asException()
          }

          bluetoothDevice.disconnect()
          gattInstance.disconnectInstance()
          gattInstance.waitForState(BluetoothProfile.STATE_DISCONNECTED)
        }
        else -> {
          Log.e(TAG, "Device type UNKNOWN")
          throw Status.UNKNOWN.asException()
        }
      }
      flow
        .filter { it.action == BluetoothDevice.ACTION_ACL_DISCONNECTED }
        .filter { it.getBluetoothDeviceExtra() == bluetoothDevice }
        .first()

      Empty.getDefaultInstance()
    }