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

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

Remove updateTunerResources AIDL API from TunerService

Tuner Service would update the resources independently

Test: android.media.tv.tuner.cts
Bug: 178124017
Change-Id: I15add963726e3cf042fe86af8d8e398f013723bb
parent 23730120
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -49,7 +49,12 @@ using ::android::hardware::tv::tuner::V1_1::FrontendDtmbCapabilities;

namespace android {

TunerService::TunerService() {}
TunerService::TunerService() {
    ::ndk::SpAIBinder binder(AServiceManager_waitForService("tv_tuner_resource_mgr"));
    mTunerResourceManager = ITunerResourceManager::fromBinder(binder);
    updateTunerResources();
}

TunerService::~TunerService() {}

binder_status_t TunerService::instantiate() {
@@ -282,19 +287,15 @@ Status TunerService::openDescrambler(int32_t /*descramblerHandle*/,
    return Status::ok();
}

Status TunerService::updateTunerResources() {
    if (!hasITuner()) {
        return Status::fromServiceSpecificError(static_cast<int32_t>(Result::UNAVAILABLE));
void TunerService::updateTunerResources() {
    if (!hasITuner() || mTunerResourceManager == NULL) {
        ALOGE("Failed to updateTunerResources");
        return;
    }

    // Connect with Tuner Resource Manager.
    ::ndk::SpAIBinder binder(AServiceManager_getService("tv_tuner_resource_mgr"));
    mTunerResourceManager = ITunerResourceManager::fromBinder(binder);

    updateFrontendResources();
    updateLnbResources();
    // TODO: update Demux, Descrambler.
    return Status::ok();
}

Status TunerService::getTunerHalVersion(int* _aidl_return) {
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ public:
    Status getDemuxCaps(TunerDemuxCapabilities* _aidl_return) override;
    Status openDescrambler(int32_t descramblerHandle,
            std::shared_ptr<ITunerDescrambler>* _aidl_return) override;
    Status updateTunerResources() override;
    Status getTunerHalVersion(int* _aidl_return) override;

    // TODO: create a map between resource id and handles.
@@ -131,6 +130,7 @@ public:
private:
    bool hasITuner();
    bool hasITuner_1_1();
    void updateTunerResources();

    void updateFrontendResources();
    void updateLnbResources();
+0 −6
Original line number Diff line number Diff line
@@ -96,12 +96,6 @@ interface ITunerService {
     */
    ITunerDescrambler openDescrambler(in int descramblerHandle);

    /**
     * Update Tuner Resources in TunerResourceManager.
     */
    // TODO: b/178124017 update TRM in TunerService independently.
    void updateTunerResources();

    /**
     * Get an integer that carries the Tuner HIDL version. The high 16 bits are the
     * major version number while the low 16 bits are the minor version. Default