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

Commit 543f0d5b authored by Thomas Girardier's avatar Thomas Girardier
Browse files

PTS-bot: fix reset

Add a delay between disable and enable in reset to avoid
Bluetooth to be disabled unwillingly after.

Bug: 234892968
Test: atest pts-bot -v
Change-Id: I72d0f4366de7dca330c5e10c0bab4f4fab7e1500
parent fad874f8
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@ import io.grpc.stub.StreamObserver
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel
import kotlinx.coroutines.cancel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filter
@@ -87,6 +88,10 @@ class Host(private val context: Context, private val server: Server) : HostImplB
        bluetoothAdapter.disable()
        bluetoothAdapter.disable()
        stateFlow.filter { it == BluetoothAdapter.STATE_OFF }.first()
        stateFlow.filter { it == BluetoothAdapter.STATE_OFF }.first()
      }
      }

      //TODO: b/234892968
      delay(2000L)

      bluetoothAdapter.enable()
      bluetoothAdapter.enable()
      stateFlow.filter { it == BluetoothAdapter.STATE_ON }.first()
      stateFlow.filter { it == BluetoothAdapter.STATE_ON }.first()