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

Commit b79fd207 authored by Amy Zhang's avatar Amy Zhang Committed by Android (Google) Code Review
Browse files

Merge "Notify TunerService to updateTunerResources when Tuner Client is init"

parents 297308fb 9eeba43c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -51,10 +51,14 @@ Result LnbClient::setCallback(sp<LnbClientCallback> cb) {
        return TunerClient::getServiceSpecificErrorCode(s);
    }

    if (mLnb != NULL) {
        mHidlCallback = new HidlLnbCallback(cb);
        return mLnb->setCallback(mHidlCallback);
    }

    return Result::INVALID_STATE;
}

Result LnbClient::setVoltage(LnbVoltage voltage) {
    if (mTunerLnb != NULL) {
        Status s = mTunerLnb->setVoltage((int)voltage);
+8 −5
Original line number Diff line number Diff line
@@ -37,7 +37,9 @@ int TunerClient::mTunerVersion;
TunerClient::TunerClient() {
    // Get HIDL Tuner in migration stage.
    getHidlTuner();
    if (mTuner != NULL) {
        updateTunerResources();
    }
    // Connect with Tuner Service.
    ::ndk::SpAIBinder binder(AServiceManager_getService("media.tuner"));
    mTunerService = ITunerService::fromBinder(binder);
@@ -45,6 +47,9 @@ TunerClient::TunerClient() {
    mTunerService = NULL;
    if (mTunerService == NULL) {
        ALOGE("Failed to get tuner service");
    } else {
        // TODO: b/178124017 update TRM in TunerService independently.
        mTunerService->updateTunerResources();
    }
}

@@ -60,10 +65,8 @@ vector<FrontendId> TunerClient::getFrontendIds() {

    if (mTunerService != NULL) {
        vector<int32_t> v;
        int aidl_return;
        Status s = mTunerService->getFrontendIds(&v, &aidl_return);
        if (!s.isOk() || aidl_return != (int) Result::SUCCESS
                || v.size() == 0) {
        Status s = mTunerService->getFrontendIds(&v);
        if (getServiceSpecificErrorCode(s) != Result::SUCCESS || v.size() == 0) {
            ids.clear();
            return ids;
        }