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

Commit e8a57377 authored by Amy Zhang's avatar Amy Zhang
Browse files

Support Link/Unlink Cicam to Frontend in Tuner HAL 1.1

The previous linkCicam API does not support local transport stream id
return. Added the support in this CL.

Also added an unlink API to unlink the cicam when needed.

INVALID_LTS_ID will be used on failed operation of linkCicam
and in Tuner java framework as the default value

Test: make android.hardware.tv.tuner@1.1-service
Bug: 158818696
Change-Id: Ief9c5097c667ce41a534b0d1d759869acd79ca7f
parent 7ad3ec8c
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -77,11 +77,22 @@ interface IFrontend extends @1.0::IFrontend {
     * directly from the frontend.
     *
     * @param ciCamId specify CI-CAM Id to link.
     * @return ltsId Local Transport Stream Id.
     * @return result Result status of the operation.
     *         SUCCESS if successful,
     *         UNKNOWN_ERROR if failed for other reasons.
     */
    linkCiCam(uint32_t ciCamId) generates (Result result);
    linkCiCam(uint32_t ciCamId) generates (Result result, uint32_t ltsId);

    /**
     * Unlink Conditional Access Modules (CAM) to Frontend.
     *
     * @param ciCamId specify CI-CAM Id to unlink.
     * @return result Result status of the operation.
     *         SUCCESS if successful,
     *         UNKNOWN_ERROR if failed for other reasons.
     */
    unlinkCiCam(uint32_t ciCamId) generates (Result result);

    /**
     * Get the v1_1 extended statuses of the frontend.
+10 −1
Original line number Diff line number Diff line
@@ -361,10 +361,19 @@ Return<Result> Frontend::setLnb(uint32_t /* lnb */) {
    return Result::SUCCESS;
}

Return<Result> Frontend::linkCiCam(uint32_t ciCamId) {
Return<void> Frontend::linkCiCam(uint32_t ciCamId, linkCiCam_cb _hidl_cb) {
    ALOGV("%s", __FUNCTION__);

    mCiCamId = ciCamId;
    _hidl_cb(Result::SUCCESS, 0 /*ltsId*/);

    return Void();
}

Return<Result> Frontend::unlinkCiCam(uint32_t /*ciCamId*/) {
    ALOGV("%s", __FUNCTION__);

    mCiCamId = -1;

    return Result::SUCCESS;
}
+3 −1
Original line number Diff line number Diff line
@@ -66,7 +66,9 @@ class Frontend : public V1_1::IFrontend {

    virtual Return<Result> setLnb(uint32_t lnb) override;

    virtual Return<Result> linkCiCam(uint32_t ciCamId) override;
    virtual Return<void> linkCiCam(uint32_t ciCamId, linkCiCam_cb _hidl_cb) override;

    virtual Return<Result> unlinkCiCam(uint32_t ciCamId) override;

    FrontendType getFrontendType();

+5 −0
Original line number Diff line number Diff line
@@ -58,6 +58,11 @@ enum Constant : @1.0::Constant {
     * be used to reset the configured ip context id.
     */
    INVALID_IP_FILTER_CONTEXT_ID = 0xFFFFFFFF,
    /**
     * An invalid local transport stream id used as the return value on a failed operation of
     * IFrontend.linkCiCam.
     */
    INVALID_LTS_ID = 0xFFFFFFFF,
};

@export