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

Commit 9eeba43c authored by Amy Zhang's avatar Amy Zhang
Browse files

Notify TunerService to updateTunerResources when Tuner Client is init

This CL also:
1. Fixed some bugs in Tuner Client.
2. Getting rid of the Result return of the getFrontendIds API in
TunerService Aidl(Since we decided to use AIDL status channel to
return the error message for all the Tuner Service APIs)

Test: atest android.media.tv.tuner.cts (LNB test only)
Bug: 159067322
Change-Id: I2fd4b8d3e5016438e61a41033e227e1311a24a21
parent f0715e0b
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;
        }