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

Commit 2ebf8172 authored by Yuyang Huang's avatar Yuyang Huang
Browse files

Remove bond at the beginning of factoryReset

This can reduce the chance that Android auto-connect remote side during factory reset

Bug: 330151782
Test: atest avatar `HfpClientTest#test_hf_indicator_setup`
Flag: Exempt, test only
Change-Id: Icf60795bea74fd8e597dd0fcc9490ae2b6e635f7
parent 43cb1f81
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -165,6 +165,11 @@ class Host(
        grpcUnary<Empty>(scope, responseObserver, 30) {
            Log.i(TAG, "factoryReset")

            // remove bond for each device to avoid auto connection if remote resets faster
            for (device in bluetoothAdapter.bondedDevices) {
                device.removeBond()
            }

            val stateFlow =
                flow
                    .filter { it.getAction() == BluetoothAdapter.ACTION_STATE_CHANGED }