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

Commit 8344d4b3 authored by Thomas Girardier's avatar Thomas Girardier Committed by Gerrit Code Review
Browse files

Merge "[Pandora] Change has<Field> to get<Field>Case"

parents 91678559 bb4870d1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -90,14 +90,14 @@ class Security(private val context: Context) : SecurityImplBase() {
      var reached =
        when (transport) {
          TRANSPORT_LE -> {
            check(request.hasLe())
            check(request.getLevelCase() == SecureRequest.LevelCase.LE);
            val level = request.le
            if (level == LE_LEVEL1) true
            if (level == LE_LEVEL4) throw Status.UNKNOWN.asException()
            false
          }
          TRANSPORT_BREDR -> {
            check(request.hasClassic())
            check(request.getLevelCase() == SecureRequest.LevelCase.CLASSIC)
            val level = request.classic
            if (level == LEVEL0) true
            if (level >= LEVEL3) throw Status.UNKNOWN.asException()
+2 −2
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ class SecurityStorage(private val context: Context) : SecurityStorageImplBase()

  override fun isBonded(request: IsBondedRequest, responseObserver: StreamObserver<BoolValue>) {
    grpcUnary(globalScope, responseObserver) {
      check(request.hasPublic())
      check(request.getAddressCase() == IsBondedRequest.AddressCase.PUBLIC)
      val bluetoothDevice = request.public.toBluetoothDevice(bluetoothAdapter)
      Log.i(TAG, "isBonded: $bluetoothDevice")
      val isBonded = bluetoothDevice.getBondState() == BluetoothDevice.BOND_BONDED
@@ -75,7 +75,7 @@ class SecurityStorage(private val context: Context) : SecurityStorageImplBase()

  override fun deleteBond(request: DeleteBondRequest, responseObserver: StreamObserver<Empty>) {
    grpcUnary(globalScope, responseObserver) {
      check(request.hasPublic())
      check(request.getAddressCase() == DeleteBondRequest.AddressCase.PUBLIC)
      val bluetoothDevice = request.public.toBluetoothDevice(bluetoothAdapter)
      Log.i(TAG, "deleteBond: device=$bluetoothDevice")