Support frontend status readiness query.
The caller could use it to check whether frontend status is ready to
read or not.
Bug: 171540820
Fix: 171540820
Test: atest android.media.tv.tuner.cts on AIDL and HILD HALs
Change-Id: I55610e02412d6043e7fab91d1a2bf187a8e5e3ba
diff --git a/media/jni/tuner/FrontendClient.cpp b/media/jni/tuner/FrontendClient.cpp
index bea0342..c6337ec 100644
--- a/media/jni/tuner/FrontendClient.cpp
+++ b/media/jni/tuner/FrontendClient.cpp
@@ -152,6 +152,16 @@
return Result::INVALID_STATE;
}
+vector<FrontendStatusReadiness> FrontendClient::getStatusReadiness(
+ const std::vector<FrontendStatusType>& statusTypes) {
+ vector<FrontendStatusReadiness> readiness;
+ if (mTunerFrontend != nullptr) {
+ mTunerFrontend->getFrontendStatusReadiness(statusTypes, &readiness);
+ }
+
+ return readiness;
+}
+
shared_ptr<ITunerFrontend> FrontendClient::getAidlFrontend() {
return mTunerFrontend;
}
diff --git a/media/jni/tuner/FrontendClient.h b/media/jni/tuner/FrontendClient.h
index c6838c8..85f6d56 100644
--- a/media/jni/tuner/FrontendClient.h
+++ b/media/jni/tuner/FrontendClient.h
@@ -35,6 +35,7 @@
using ::aidl::android::hardware::tv::tuner::FrontendScanType;
using ::aidl::android::hardware::tv::tuner::FrontendSettings;
using ::aidl::android::hardware::tv::tuner::FrontendStatus;
+using ::aidl::android::hardware::tv::tuner::FrontendStatusReadiness;
using ::aidl::android::hardware::tv::tuner::FrontendStatusType;
using ::aidl::android::hardware::tv::tuner::FrontendType;
using ::aidl::android::hardware::tv::tuner::Result;
@@ -125,6 +126,12 @@
*/
Result removeOutputPid(int32_t pid);
+ /**
+ * Gets Frontend Status Readiness statuses for given status types.
+ */
+ vector<FrontendStatusReadiness> getStatusReadiness(
+ const std::vector<FrontendStatusType>& types);
+
int32_t getId();
shared_ptr<ITunerFrontend> getAidlFrontend();