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

Commit c3aa0f38 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add new features to tuner service."

parents 0cc6f866 d8ccaaea
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -115,16 +115,6 @@ TunerFrontend::~TunerFrontend() {
    return mFrontend->setLnb(static_cast<TunerLnb*>(lnb.get())->getId());
}

::ndk::ScopedAStatus TunerFrontend::setLna(bool bEnable) {
    if (mFrontend == nullptr) {
        ALOGD("IFrontend is not initialized");
        return ::ndk::ScopedAStatus::fromServiceSpecificError(
                static_cast<int32_t>(Result::UNAVAILABLE));
    }

    return mFrontend->setLna(bEnable);
}

::ndk::ScopedAStatus TunerFrontend::linkCiCamToFrontend(int32_t ciCamId, int32_t* _aidl_return) {
    if (mFrontend == nullptr) {
        ALOGD("IFrontend is not initialized");
@@ -174,6 +164,16 @@ TunerFrontend::~TunerFrontend() {
    return ::ndk::ScopedAStatus::ok();
}

::ndk::ScopedAStatus TunerFrontend::getHardwareInfo(std::string* _aidl_return) {
    if (mFrontend == nullptr) {
        ALOGD("IFrontend is not initialized");
        return ::ndk::ScopedAStatus::fromServiceSpecificError(
                static_cast<int32_t>(Result::UNAVAILABLE));
    }

    return mFrontend->getHardwareInfo(_aidl_return);
}

/////////////// FrontendCallback ///////////////////////
::ndk::ScopedAStatus TunerFrontend::FrontendCallback::onEvent(FrontendEventType frontendEventType) {
    ALOGV("FrontendCallback::onEvent, type=%d", frontendEventType);
+1 −1
Original line number Diff line number Diff line
@@ -56,13 +56,13 @@ public:
                              FrontendScanType in_frontendScanType) override;
    ::ndk::ScopedAStatus stopScan() override;
    ::ndk::ScopedAStatus setLnb(const shared_ptr<ITunerLnb>& in_lnb) override;
    ::ndk::ScopedAStatus setLna(bool in_bEnable) override;
    ::ndk::ScopedAStatus linkCiCamToFrontend(int32_t in_ciCamId, int32_t* _aidl_return) override;
    ::ndk::ScopedAStatus unlinkCiCamToFrontend(int32_t in_ciCamId) override;
    ::ndk::ScopedAStatus close() override;
    ::ndk::ScopedAStatus getStatus(const vector<FrontendStatusType>& in_statusTypes,
                                   vector<FrontendStatus>* _aidl_return) override;
    ::ndk::ScopedAStatus getFrontendId(int32_t* _aidl_return) override;
    ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override;

    struct FrontendCallback : public BnFrontendCallback {
        FrontendCallback(const shared_ptr<ITunerFrontendCallback> tunerFrontendCallback)
+10 −0
Original line number Diff line number Diff line
@@ -260,6 +260,16 @@ bool TunerService::hasITuner() {
    return ::ndk::ScopedAStatus::ok();
}

::ndk::ScopedAStatus TunerService::setLna(bool bEnable) {
    if (!hasITuner()) {
        ALOGD("get ITuner failed");
        return ::ndk::ScopedAStatus::fromServiceSpecificError(
                static_cast<int32_t>(Result::UNAVAILABLE));
    }

    return mTuner->setLna(bEnable);
}

string TunerService::addFilterToShared(const shared_ptr<TunerFilter>& sharedFilter) {
    Mutex::Autolock _l(mSharedFiltersLock);

+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ public:
    ::ndk::ScopedAStatus openSharedFilter(const string& in_filterToken,
                                          const shared_ptr<ITunerFilterCallback>& in_cb,
                                          shared_ptr<ITunerFilter>* _aidl_return) override;
    ::ndk::ScopedAStatus setLna(bool in_bEnable) override;

    string addFilterToShared(const shared_ptr<TunerFilter>& sharedFilter);
    void removeSharedFilter(const shared_ptr<TunerFilter>& sharedFilter);
+5 −7
Original line number Diff line number Diff line
@@ -68,13 +68,6 @@ interface ITunerFrontend {
     */
    void setLnb(in ITunerLnb lnb);

    /**
     * Enable or Disable Low Noise Amplifier (LNA).
     *
     * @param bEnable enable Lna or not.
     */
    void setLna(in boolean bEnable);

    /**
     * Link Frontend to the cicam with given id.
     *
@@ -101,4 +94,9 @@ interface ITunerFrontend {
     * Gets the id of the frontend.
     */
    int getFrontendId();

    /**
     * Request hardware information about the frontend.
     */
    String getHardwareInfo();
}
Loading