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

Commit a90036c6 authored by Alice Kuo's avatar Alice Kuo Committed by Automerger Merge Worker
Browse files

Merge "Remove HIDL 2.2 client integration" am: daa7c0ef am: 7096d634 am: a055f2d0

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

Change-Id: I680a43e2a81966232aef7accd819b7471d35e961
parents a8ca815d a055f2d0
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ cc_library_static {
    shared_libs: [
        "android.hardware.bluetooth.audio@2.0",
        "android.hardware.bluetooth.audio@2.1",
        "android.hardware.bluetooth.audio@2.2",
        "libhidlbase",
    ],
    static_libs: [
@@ -85,7 +84,6 @@ cc_test {
    shared_libs: [
        "android.hardware.bluetooth.audio@2.0",
        "android.hardware.bluetooth.audio@2.1",
        "android.hardware.bluetooth.audio@2.2",
        "android.hardware.bluetooth.audio-V1-ndk",
        "libbinder_ndk",
        "libcutils",
+2 −4
Original line number Diff line number Diff line
@@ -140,12 +140,10 @@ void set_remote_delay(uint16_t delay_report) {
// Set low latency buffer mode allowed or disallowed
void set_audio_low_latency_mode_allowed(bool allowed) {
  if (HalVersionManager::GetHalTransport() ==
      BluetoothAudioHalTransport::HIDL) {
    hidl::a2dp::set_low_latency_mode_allowed(allowed);
    return;
  }
      BluetoothAudioHalTransport::AIDL) {
    aidl::a2dp::set_low_latency_mode_allowed(allowed);
  }
}

}  // namespace a2dp
}  // namespace audio
+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ cc_defaults {
        "android.hardware.bluetooth.a2dp@1.0",
        "android.hardware.bluetooth.audio@2.0",
        "android.hardware.bluetooth.audio@2.1",
        "android.hardware.bluetooth.audio@2.2",
        "android.system.suspend.control-V1-ndk",
        "android.system.suspend-V1-ndk",
    ],
+0 −4
Original line number Diff line number Diff line
@@ -169,8 +169,6 @@ class TestSinkTransport
  void ResetPresentationPosition() override{};

  void LogBytesRead(size_t) override{};

  void SinkMetadataChanged(const sink_metadata_t&) override{};
};

class TestSourceTransport
@@ -204,8 +202,6 @@ class TestSourceTransport
  void ResetPresentationPosition() override{};

  void LogBytesWritten(size_t) override{};

  void SinkMetadataChanged(const sink_metadata_t&) override{};
};

class ClientInterfaceFuzzer {
+0 −31
Original line number Diff line number Diff line
@@ -48,30 +48,12 @@ BluetoothAudioHalTransport HalVersionManager::GetHalTransport() {
      return BluetoothAudioHalTransport::AIDL;
    case BluetoothAudioHalVersion::VERSION_2_0:
    case BluetoothAudioHalVersion::VERSION_2_1:
    case BluetoothAudioHalVersion::VERSION_2_2:
      return BluetoothAudioHalTransport::HIDL;
    default:
      return BluetoothAudioHalTransport::UNKNOWN;
  }
}

android::sp<IBluetoothAudioProvidersFactory_2_2>
HalVersionManager::GetProvidersFactory_2_2() {
  std::lock_guard<std::mutex> guard(instance_ptr->mutex_);
  if (instance_ptr->hal_version_ != BluetoothAudioHalVersion::VERSION_2_2) {
    return nullptr;
  }
  android::sp<IBluetoothAudioProvidersFactory_2_2> providers_factory =
      IBluetoothAudioProvidersFactory_2_2::getService();
  CHECK(providers_factory)
      << "V2_2::IBluetoothAudioProvidersFactory::getService() failed";

  LOG(INFO) << "V2_2::IBluetoothAudioProvidersFactory::getService() returned "
            << providers_factory.get()
            << (providers_factory->isRemote() ? " (remote)" : " (local)");
  return providers_factory;
}

android::sp<IBluetoothAudioProvidersFactory_2_1>
HalVersionManager::GetProvidersFactory_2_1() {
  std::lock_guard<std::mutex> guard(instance_ptr->mutex_);
@@ -124,19 +106,6 @@ HalVersionManager::HalVersionManager() {
        instance_count = instanceNames.size();
      };
  auto hidl_retval = service_manager->listManifestByInterface(
      kFullyQualifiedInterfaceName_2_2, listManifestByInterface_cb);
  if (!hidl_retval.isOk()) {
    LOG(FATAL) << __func__ << ": IServiceManager::listByInterface failure: "
               << hidl_retval.description();
    return;
  }

  if (instance_count > 0) {
    hal_version_ = BluetoothAudioHalVersion::VERSION_2_2;
    return;
  }

  hidl_retval = service_manager->listManifestByInterface(
      kFullyQualifiedInterfaceName_2_1, listManifestByInterface_cb);
  if (!hidl_retval.isOk()) {
    LOG(FATAL) << __func__ << ": IServiceManager::listByInterface failure: "
Loading