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

Commit c8c7459d authored by Fahad Afroze's avatar Fahad Afroze Committed by Automerger Merge Worker
Browse files

[PTS-Bot]: Removed rebootBluetooth call from factoryReset function in Host am: 0c46bbae

parents 21340301 0c46bbae
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -127,13 +127,17 @@ class Host(
  }

  override fun factoryReset(request: Empty, responseObserver: StreamObserver<Empty>) {
    grpcUnary<Empty>(scope, responseObserver, 10) {
    grpcUnary<Empty>(scope, responseObserver, 30) {
      Log.i(TAG, "factoryReset")

      bluetoothAdapter.clearBluetooth()
      val stateFlow =
      flow
        .filter { it.getAction() == BluetoothAdapter.ACTION_STATE_CHANGED }
        .map { it.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR) }

      rebootBluetooth()
      bluetoothAdapter.clearBluetooth()

      stateFlow.filter { it == BluetoothAdapter.STATE_ON }.first()
      Log.i(TAG, "Shutdown the gRPC Server")
      server.shutdown()