VTS implementation for ImsMediaHal
Bug: 263201546
Test: atest VtsHalRadioTargetTest (using cuttlefish)
Change-Id: I38eacded9a4523b7c5121f2d759d9b118923bcc7
diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp
index 6bbc9fe..9aecf78 100644
--- a/radio/aidl/compat/libradiocompat/Android.bp
+++ b/radio/aidl/compat/libradiocompat/Android.bp
@@ -38,6 +38,7 @@
"android.hardware.radio.config@1.3",
"android.hardware.radio.data-V2-ndk",
"android.hardware.radio.ims-V1-ndk",
+ "android.hardware.radio.ims.media-V1-ndk",
"android.hardware.radio.messaging-V2-ndk",
"android.hardware.radio.modem-V2-ndk",
"android.hardware.radio.network-V2-ndk",
@@ -75,6 +76,8 @@
"ims/RadioIndication-ims.cpp",
"ims/RadioResponse-ims.cpp",
"ims/RadioIms.cpp",
+ "ims/media/RadioImsMediaSession.cpp",
+ "ims/media/RadioImsMedia.cpp",
"messaging/RadioIndication-messaging.cpp",
"messaging/RadioMessaging.cpp",
"messaging/RadioResponse-messaging.cpp",
diff --git a/radio/aidl/compat/libradiocompat/ims/media/RadioImsMedia.cpp b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMedia.cpp
new file mode 100644
index 0000000..464a410
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMedia.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <libradiocompat/RadioImsMedia.h>
+
+#include "commonStructs.h"
+#include "debug.h"
+
+#include "collections.h"
+
+#define RADIO_MODULE "ImsMedia"
+
+namespace android::hardware::radio::compat {
+
+using ::ndk::ScopedAStatus;
+constexpr auto ok = &ScopedAStatus::ok;
+
+ScopedAStatus RadioImsMedia::setListener(
+ const std::shared_ptr<::aidl::android::hardware::radio::ims::media::
+ IImsMediaListener>& /*in_mediaListener*/) {
+ LOG(ERROR) << " setListener is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMedia::openSession(
+ int32_t /*in_sessionId*/,
+ const ::aidl::android::hardware::radio::ims::media::LocalEndPoint& /*in_localEndPoint*/,
+ const ::aidl::android::hardware::radio::ims::media::RtpConfig& /*in_config*/) {
+ LOG(ERROR) << " openSession is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMedia::closeSession(int32_t /*in_sessionId*/) {
+ LOG(ERROR) << " closeSession is unsupported by HIDL HALs";
+ return ok();
+}
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp
new file mode 100644
index 0000000..ae86914
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <libradiocompat/RadioImsMediaSession.h>
+
+#include "commonStructs.h"
+#include "debug.h"
+
+#include "collections.h"
+
+#define RADIO_MODULE "ImsMediaSession"
+
+namespace android::hardware::radio::compat {
+
+using ::ndk::ScopedAStatus;
+namespace aidl = ::aidl::android::hardware::radio::ims::media;
+constexpr auto ok = &ScopedAStatus::ok;
+
+ScopedAStatus RadioImsMediaSession::setListener(
+ const std::shared_ptr<aidl::IImsMediaSessionListener>& /*in_sessionListener*/) {
+ LOG(ERROR) << " setListener is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMediaSession::modifySession(const aidl::RtpConfig& /*in_config*/) {
+ LOG(ERROR) << " modifySession is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMediaSession::sendDtmf(char16_t /*in_dtmfDigit*/, int32_t /*in_duration*/) {
+ LOG(ERROR) << " sendDtmf is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMediaSession::startDtmf(char16_t /*in_dtmfDigit*/) {
+ LOG(ERROR) << " startDtmf is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMediaSession::stopDtmf() {
+ LOG(ERROR) << " stopDtmf is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMediaSession::sendHeaderExtension(
+ const std::vector<aidl::RtpHeaderExtension>& /*in_extensions*/) {
+ LOG(ERROR) << " sendHeaderExtension is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMediaSession::setMediaQualityThreshold(
+ const aidl::MediaQualityThreshold& /*in_threshold*/) {
+ LOG(ERROR) << " setMediaQualityThreshold is unsupported by HIDL HALs";
+ return ok();
+}
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMedia.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMedia.h
new file mode 100644
index 0000000..2ee6bf1
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMedia.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include "RadioCompatBase.h"
+
+#include <aidl/android/hardware/radio/ims/media/BnImsMedia.h>
+
+namespace android::hardware::radio::compat {
+
+class RadioImsMedia : public RadioCompatBase,
+ public aidl::android::hardware::radio::ims::media::BnImsMedia {
+ ::ndk::ScopedAStatus setListener(
+ const std::shared_ptr<::aidl::android::hardware::radio::ims::media::IImsMediaListener>&
+ in_mediaListener) override;
+ ::ndk::ScopedAStatus openSession(
+ int32_t in_sessionId,
+ const ::aidl::android::hardware::radio::ims::media::LocalEndPoint& in_localEndPoint,
+ const ::aidl::android::hardware::radio::ims::media::RtpConfig& in_config) override;
+ ::ndk::ScopedAStatus closeSession(int32_t in_sessionId) override;
+
+ protected:
+ public:
+ using RadioCompatBase::RadioCompatBase;
+};
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h
new file mode 100644
index 0000000..00f21fc
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include "RadioCompatBase.h"
+
+#include <aidl/android/hardware/radio/ims/media/BnImsMediaSession.h>
+
+namespace android::hardware::radio::compat {
+
+class RadioImsMediaSession : public RadioCompatBase,
+ public aidl::android::hardware::radio::ims::media::BnImsMediaSession {
+ ::ndk::ScopedAStatus setListener(
+ const std::shared_ptr<
+ ::aidl::android::hardware::radio::ims::media::IImsMediaSessionListener>&
+ in_sessionListener) override;
+ ::ndk::ScopedAStatus modifySession(
+ const ::aidl::android::hardware::radio::ims::media::RtpConfig& in_config) override;
+ ::ndk::ScopedAStatus sendDtmf(char16_t in_dtmfDigit, int32_t in_duration) override;
+ ::ndk::ScopedAStatus startDtmf(char16_t in_dtmfDigit) override;
+ ::ndk::ScopedAStatus stopDtmf() override;
+ ::ndk::ScopedAStatus sendHeaderExtension(
+ const std::vector<::aidl::android::hardware::radio::ims::media::RtpHeaderExtension>&
+ in_extensions) override;
+ ::ndk::ScopedAStatus setMediaQualityThreshold(
+ const ::aidl::android::hardware::radio::ims::media::MediaQualityThreshold& in_threshold)
+ override;
+
+ protected:
+ public:
+ using RadioCompatBase::RadioCompatBase;
+};
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h
index 636c1a4..b976435 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h
@@ -20,6 +20,7 @@
#include <aidl/android/hardware/radio/data/IRadioDataResponse.h>
#include <aidl/android/hardware/radio/ims/IRadioImsResponse.h>
+#include <aidl/android/hardware/radio/ims/media/IImsMediaListener.h>
#include <aidl/android/hardware/radio/messaging/IRadioMessagingResponse.h>
#include <aidl/android/hardware/radio/modem/IRadioModemResponse.h>
#include <aidl/android/hardware/radio/network/IRadioNetworkResponse.h>
diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp
index a3717b4..5d14c85 100644
--- a/radio/aidl/compat/service/Android.bp
+++ b/radio/aidl/compat/service/Android.bp
@@ -41,6 +41,7 @@
"android.hardware.radio.config@1.3",
"android.hardware.radio.data-V2-ndk",
"android.hardware.radio.ims-V1-ndk",
+ "android.hardware.radio.ims.media-V1-ndk",
"android.hardware.radio.messaging-V2-ndk",
"android.hardware.radio.modem-V2-ndk",
"android.hardware.radio.network-V2-ndk",