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

Commit 2dd1d8dc authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

Add getProgramList call.

Test: existing VTS tests pass, but none added.
Bug: b/34054813
Change-Id: I33891256c0b7ba7edd8ca42074e65900169e2952
parent c2a7548b
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -19,11 +19,32 @@ package android.hardware.broadcastradio@1.1;
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);

};
+7 −0
Original line number Diff line number Diff line
@@ -200,6 +200,13 @@ exit:
    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
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ struct Tuner : public ITuner {
    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);
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,12 @@ import @1.0::types;

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