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

Commit 36047458 authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "[PANDORA_TEST] pts-bot HFP Coverage: HFI & SLC" am: 520daca6 am:...

Merge "[PANDORA_TEST] pts-bot HFP Coverage: HFI & SLC" am: 520daca6 am: 3a7b621b am: 23e9a034 am: d58ed1a4

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2151599



Change-Id: I71bb532b7e683c42def8cd722456c06adcf9e3d1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e5578b99 d58ed1a4
Loading
Loading
Loading
Loading
+15 −1
Original line number Original line Diff line number Diff line
@@ -30,6 +30,8 @@ class HFPProxy(ProfileProxy):
        self.hfp = HFP(channel)
        self.hfp = HFP(channel)
        self.host = Host(channel)
        self.host = Host(channel)


        self.connection = None

    @assert_description
    @assert_description
    def TSC_delete_pairing_iut(self, pts_addr: bytes, **kwargs):
    def TSC_delete_pairing_iut(self, pts_addr: bytes, **kwargs):
        """
        """
@@ -40,6 +42,18 @@ class HFPProxy(ProfileProxy):
        self.host.DeletePairing(address=pts_addr)
        self.host.DeletePairing(address=pts_addr)
        return "OK"
        return "OK"


    @assert_description
    def TSC_iut_enable_slc(self, pts_addr: bytes, **kwargs):
        """
        Click Ok, then initiate a service level connection from the
        Implementation Under Test (IUT) to the PTS.
        """

        if not self.connection:
            self.connection = self.host.Connect(address=pts_addr).connection
        self.hfp.EnableSlc(connection=self.connection)
        return "OK"

    @assert_description
    @assert_description
    def TSC_iut_search(self, **kwargs):
    def TSC_iut_search(self, **kwargs):
        """
        """
@@ -66,5 +80,5 @@ class HFPProxy(ProfileProxy):
        Implementation Under Test (IUT).
        Implementation Under Test (IUT).
        """
        """


        self.hfp.DisableSlc(address=pts_addr)
        self.hfp.DisableSlc(connection=self.connection)
        return "OK"
        return "OK"
+2 −0
Original line number Original line Diff line number Diff line
@@ -23,5 +23,7 @@
        <option name="profile" value="A2DP/SRC" />
        <option name="profile" value="A2DP/SRC" />
        <option name="profile" value="AVDTP/SRC" />
        <option name="profile" value="AVDTP/SRC" />
        <option name="profile" value="HFP/AG/DIS" />
        <option name="profile" value="HFP/AG/DIS" />
        <option name="profile" value="HFP/AG/HFI" />
        <option name="profile" value="HFP/AG/SLC" />
    </test>
    </test>
</configuration>
</configuration>
+14 −2
Original line number Original line Diff line number Diff line
@@ -40,7 +40,12 @@
    "AVDTP/SRC/INT/SIG/SMG/BV-28-C",
    "AVDTP/SRC/INT/SIG/SMG/BV-28-C",
    "AVDTP/SRC/INT/SIG/SMG/BV-31-C",
    "AVDTP/SRC/INT/SIG/SMG/BV-31-C",
    "AVDTP/SRC/INT/SIG/SYN/BV-05-C",
    "AVDTP/SRC/INT/SIG/SYN/BV-05-C",
    "AVDTP/SRC/INT/TRA/BTR/BV-01-C"
    "AVDTP/SRC/INT/TRA/BTR/BV-01-C",
    "HFP/AG/DIS/BV-01-I",
    "HFP/AG/HFI/BI-03-I",
    "HFP/AG/HFI/BV-02-I",
    "HFP/AG/SLC/BV-09-I",
    "HFP/AG/SLC/BV-10-I"
  ],
  ],
  "skip": [
  "skip": [
    "A2DP/SRC/AS/BV-01-I",
    "A2DP/SRC/AS/BV-01-I",
@@ -61,7 +66,14 @@
    "AVDTP/SRC/INT/SIG/SMG/BV-11-C",
    "AVDTP/SRC/INT/SIG/SMG/BV-11-C",
    "AVDTP/SRC/INT/SIG/SMG/BV-13-C",
    "AVDTP/SRC/INT/SIG/SMG/BV-13-C",
    "AVDTP/SRC/INT/SIG/SMG/BV-23-C",
    "AVDTP/SRC/INT/SIG/SMG/BV-23-C",
    "AVDTP/SRC/INT/SIG/SMG/ESR05/BV-13-C"
    "AVDTP/SRC/INT/SIG/SMG/ESR05/BV-13-C",
    "HFP/AG/SLC/BV-01-C",
    "HFP/AG/SLC/BV-02-C",
    "HFP/AG/SLC/BV-03-C",
    "HFP/AG/SLC/BV-04-C",
    "HFP/AG/SLC/BV-05-I",
    "HFP/AG/SLC/BV-06-I",
    "HFP/AG/SLC/BV-07-I"
  ],
  ],
  "ics": {
  "ics": {
    "TSPC_4.0HCI_1a_2": true,
    "TSPC_4.0HCI_1a_2": true,
+12 −7
Original line number Original line Diff line number Diff line
@@ -5,19 +5,24 @@ option java_outer_classname = "HfpProto";
package pandora;
package pandora;


import "pandora/host.proto";
import "pandora/host.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/empty.proto";


// Service to trigger HFP (Hands Free Profile) procedures.
// Service to trigger HFP (Hands Free Profile) procedures.
service HFP {
service HFP {
  // Enable Service level connection
  rpc EnableSlc(EnableSlcRequest) returns (google.protobuf.Empty);
  // Disable Service level connection
  // Disable Service level connection
  rpc DisableSlc(DisableSlcRequest) returns (DisableSlcResponse);
  rpc DisableSlc(DisableSlcRequest) returns (google.protobuf.Empty);
}

// Request of the `EnableSlc` method.
message EnableSlcRequest {
  // Connection crafted by grpc server
  Connection connection = 1;
}
}


// Request of the `DisableSlc` method.
// Request of the `DisableSlc` method.
message DisableSlcRequest {
message DisableSlcRequest {
  // Local Bluetooth Device Address as array of 6 bytes.
  // Connection crafted by grpc server
  bytes address = 1;
  Connection connection = 1;
}
}

// Response of the `DisableSlc` method.
message DisableSlcResponse {}
+15 −7
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@ import android.bluetooth.BluetoothProfile
import android.content.Context
import android.content.Context
import android.content.Intent
import android.content.Intent
import android.content.IntentFilter
import android.content.IntentFilter
import com.google.protobuf.Empty
import io.grpc.stub.StreamObserver
import io.grpc.stub.StreamObserver
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Dispatchers
@@ -56,16 +57,23 @@ class Hfp(val context: Context) : HFPImplBase() {
    scope.cancel()
    scope.cancel()
  }
  }


  override fun disableSlc(
  override fun enableSlc(request: EnableSlcRequest, responseObserver: StreamObserver<Empty>) {
    request: DisableSlcRequest,
    grpcUnary<Empty>(scope, responseObserver) {
    responseObserver: StreamObserver<DisableSlcResponse>
      val device = request.connection.toBluetoothDevice(bluetoothAdapter)
  ) {

    grpcUnary<DisableSlcResponse>(scope, responseObserver) {
      bluetoothHfp.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED)
      val device = request.address.toBluetoothDevice(bluetoothAdapter)

      Empty.getDefaultInstance()
    }
  }

  override fun disableSlc(request: DisableSlcRequest, responseObserver: StreamObserver<Empty>) {
    grpcUnary<Empty>(scope, responseObserver) {
      val device = request.connection.toBluetoothDevice(bluetoothAdapter)


      bluetoothHfp.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN)
      bluetoothHfp.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN)


      DisableSlcResponse.getDefaultInstance()
      Empty.getDefaultInstance()
    }
    }
  }
  }
}
}
Loading