Add getProgramList call.
Test: existing VTS tests pass, but none added.
Bug: b/34054813
Change-Id: I33891256c0b7ba7edd8ca42074e65900169e2952
diff --git a/broadcastradio/1.1/ITuner.hal b/broadcastradio/1.1/ITuner.hal
index 72b2847..4f34019 100644
--- a/broadcastradio/1.1/ITuner.hal
+++ b/broadcastradio/1.1/ITuner.hal
@@ -19,11 +19,32 @@
import @1.0::ITuner;
interface ITuner extends @1.0::ITuner {
- /*
+
+ /**
* Retrieve current station information.
* @return result OK if scan successfully started
* NOT_INITIALIZED if another error occurs
* @return info Current program information.
*/
getProgramInformation_1_1() generates(Result result, ProgramInfo info);
+
+ /**
+ * Retrieve station list.
+ *
+ * This call does not trigger actual scan, but operates on the list cached
+ * internally at the driver level.
+ *
+ * @param filter vendor-specific filter for the stations to be retrieved.
+ * An empty string MUST result in full list.
+ * Client application MUST verify vendor/product name
+ * before setting this parameter to anything else.
+ * @return result OK if the list was successfully retrieved.
+ * NOT_READY if the scan is in progress.
+ * NOT_STARTED if the scan has not been started.
+ * NOT_INITIALIZED if any other error occurs.
+ * @return programList List of stations available for user.
+ */
+ getProgramList(string filter)
+ generates(ProgramListResult result, vec<ProgramInfo> programList);
+
};
diff --git a/broadcastradio/1.1/default/Tuner.cpp b/broadcastradio/1.1/default/Tuner.cpp
index 6258569..b4eb184 100644
--- a/broadcastradio/1.1/default/Tuner.cpp
+++ b/broadcastradio/1.1/default/Tuner.cpp
@@ -200,6 +200,13 @@
return Void();
}
+Return<void> Tuner::getProgramList(const hidl_string& filter __unused, getProgramList_cb _hidl_cb) {
+ hidl_vec<ProgramInfo> pList;
+ // TODO(b/34054813): do the actual implementation.
+ _hidl_cb(ProgramListResult::NOT_INITIALIZED, pList);
+ return Void();
+}
+
} // namespace implementation
} // namespace V1_1
} // namespace broadcastradio
diff --git a/broadcastradio/1.1/default/Tuner.h b/broadcastradio/1.1/default/Tuner.h
index 1f3dc7f..fcf053a 100644
--- a/broadcastradio/1.1/default/Tuner.h
+++ b/broadcastradio/1.1/default/Tuner.h
@@ -42,6 +42,7 @@
Return<Result> cancel() override;
Return<void> getProgramInformation(getProgramInformation_cb _hidl_cb) override;
Return<void> getProgramInformation_1_1(getProgramInformation_1_1_cb _hidl_cb) override;
+ Return<void> getProgramList(const hidl_string& filter, getProgramList_cb _hidl_cb) override;
static void callback(radio_hal_event_t *halEvent, void *cookie);
void onCallback(radio_hal_event_t *halEvent);
diff --git a/broadcastradio/1.1/types.hal b/broadcastradio/1.1/types.hal
index 38f4b39..3b212eb 100644
--- a/broadcastradio/1.1/types.hal
+++ b/broadcastradio/1.1/types.hal
@@ -20,6 +20,12 @@
typedef @1.0::Result Result;
+enum ProgramListResult : Result {
+ NOT_READY,
+ NOT_STARTED,
+ TEMPORARILY_UNAVAILABLE,
+};
+
enum DigitalStatus : int32_t {
INVALID = -1,
UNAVAILABLE = 1, // current program is analog-only