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

Commit f6964ffa authored by Hongguang's avatar Hongguang
Browse files

Add API to filter out unnecessary PIDs from frontend output.

Bug: 213287138
Test: atest android.media.tv.tuner.cts on AIDL and HIDL HALs
Change-Id: I1fa68b6d13a18de760f4c423ddec1e74ba2adf45
parent 9260f561
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -174,6 +174,16 @@ TunerFrontend::~TunerFrontend() {
    return mFrontend->getHardwareInfo(_aidl_return);
}

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

    return mFrontend->removeOutputPid(in_pid);
}

/////////////// FrontendCallback ///////////////////////
::ndk::ScopedAStatus TunerFrontend::FrontendCallback::onEvent(FrontendEventType frontendEventType) {
    ALOGV("FrontendCallback::onEvent, type=%d", frontendEventType);
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ public:
                                   vector<FrontendStatus>* _aidl_return) override;
    ::ndk::ScopedAStatus getFrontendId(int32_t* _aidl_return) override;
    ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override;
    ::ndk::ScopedAStatus removeOutputPid(int32_t in_pid) override;

    struct FrontendCallback : public BnFrontendCallback {
        FrontendCallback(const shared_ptr<ITunerFrontendCallback> tunerFrontendCallback)
+5 −0
Original line number Diff line number Diff line
@@ -99,4 +99,9 @@ interface ITunerFrontend {
     * Request hardware information about the frontend.
     */
    String getHardwareInfo();

    /**
     * Filter out unnecessary PID from frontend output.
     */
    void removeOutputPid(int pid);
}
+5 −0
Original line number Diff line number Diff line
@@ -428,6 +428,11 @@ TunerHidlFrontend::~TunerHidlFrontend() {
            static_cast<int32_t>(Result::UNAVAILABLE));
}

::ndk::ScopedAStatus TunerHidlFrontend::removeOutputPid(int32_t /* in_pid */) {
    return ::ndk::ScopedAStatus::fromServiceSpecificError(
            static_cast<int32_t>(Result::UNAVAILABLE));
}

void TunerHidlFrontend::setLna(bool bEnable) {
    if (mFrontend == nullptr) {
        ALOGD("IFrontend is not initialized");
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ public:
                                   vector<FrontendStatus>* _aidl_return) override;
    ::ndk::ScopedAStatus getFrontendId(int32_t* _aidl_return) override;
    ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override;
    ::ndk::ScopedAStatus removeOutputPid(int32_t in_pid) override;

    void setLna(bool in_bEnable);