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

Commit 979120df authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk Committed by Android (Google) Code Review
Browse files

Merge "Add analog force mode for analog/digital hybrid modes."

parents 00e38b57 c7002820
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -74,4 +74,33 @@ interface ITuner extends @1.0::ITuner {
    getProgramList(string filter)
        generates (ProgramListResult result, vec<ProgramInfo> programList);

    /**
     * Checks, if the analog playback is forced, see setAnalogForced.
     *
     * The isForced value is only valid if result was OK.
     *
     * @return result OK if the call succeeded and isForced is valid.
     *                INVALID_STATE if the switch is not supported at current
     *                configuration.
     *                NOT_INITIALIZED if any other error occurs.
     * @return isForced true if analog is forced, false otherwise.
     */
    isAnalogForced() generates (Result result, bool isForced);

    /**
     * Forces the analog playback for the supporting radio technology.
     *
     * User may disable digital playback for FM HD Radio or hybrid FM/DAB with
     * this option. This is purely user choice, ie. does not reflect digital-
     * analog handover managed from the HAL implementation side.
     *
     * Some radio technologies may not support this, ie. DAB.
     *
     * @param isForced true to force analog, false for a default behaviour.
     * @return result OK if the setting was successfully done.
     *                INVALID_STATE if the switch is not supported at current
     *                configuration.
     *                NOT_INITIALIZED if any other error occurs.
     */
    setAnalogForced(bool isForced) generates (Result result);
};
+11 −0
Original line number Diff line number Diff line
@@ -211,6 +211,17 @@ Return<void> Tuner::getProgramList(const hidl_string& filter __unused, getProgra
    return Void();
}

Return<void> Tuner::isAnalogForced(isAnalogForced_cb _hidl_cb) {
    // TODO(b/34348946): do the actual implementation.
    _hidl_cb(Result::NOT_INITIALIZED, false);
    return Void();
}

Return<Result> Tuner::setAnalogForced(bool isForced __unused) {
    // TODO(b/34348946): do the actual implementation.
    return Result::NOT_INITIALIZED;
}

} // namespace implementation
}  // namespace V1_1
}  // namespace broadcastradio
+2 −0
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@ struct Tuner : public ITuner {
    Return<void> getProgramInformation_1_1(getProgramInformation_1_1_cb _hidl_cb) override;
    Return<ProgramListResult> startBackgroundScan() override;
    Return<void> getProgramList(const hidl_string& filter, getProgramList_cb _hidl_cb) override;
    Return<void> isAnalogForced(isAnalogForced_cb _hidl_cb) override;
    Return<Result> setAnalogForced(bool isForced) override;

    static void callback(radio_hal_event_t *halEvent, void *cookie);
    void onCallback(radio_hal_event_t *halEvent);