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

Commit a9cb865f authored by Ray Chin's avatar Ray Chin
Browse files

Add isLnaSupported API

Bug: 239240674
Test: atest android.media.tv.tuner.cts with cf_x86_tv-userdebug
Change-Id: I94527e9ce73f5b7f13674aff34e419668ec8a425
parent 2ea68a82
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -194,6 +194,11 @@ binder_status_t TunerService::instantiate() {
    return ::ndk::ScopedAStatus::ok();
}

::ndk::ScopedAStatus TunerService::isLnaSupported(bool* _aidl_return) {
    ALOGV("isLnaSupported");
    return mTuner->isLnaSupported(_aidl_return);
}

::ndk::ScopedAStatus TunerService::setLna(bool bEnable) {
    return mTuner->setLna(bEnable);
}
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ public:
    ::ndk::ScopedAStatus openSharedFilter(const string& in_filterToken,
                                          const shared_ptr<ITunerFilterCallback>& in_cb,
                                          shared_ptr<ITunerFilter>* _aidl_return) override;
    ::ndk::ScopedAStatus isLnaSupported(bool* _aidl_return) override;
    ::ndk::ScopedAStatus setLna(bool in_bEnable) override;
    ::ndk::ScopedAStatus setMaxNumberOfFrontends(FrontendType in_frontendType,
                                                 int32_t in_maxNumber) override;
+7 −0
Original line number Diff line number Diff line
@@ -106,6 +106,13 @@ interface ITunerService {
     */
    ITunerFilter openSharedFilter(in String filterToken, in ITunerFilterCallback cb);

    /**
     * Is Low Noise Amplifier (LNA) supported by the Tuner.
     *
     * @return {@code true} if supported, otherwise {@code false}.
     */
    boolean isLnaSupported();

    /**
     * Enable or Disable Low Noise Amplifier (LNA).
     *
+5 −0
Original line number Diff line number Diff line
@@ -302,6 +302,11 @@ binder_status_t TunerHidlService::instantiate() {
    return ::ndk::ScopedAStatus::ok();
}

::ndk::ScopedAStatus TunerHidlService::isLnaSupported(bool* /* _aidl_return */) {
    return ::ndk::ScopedAStatus::fromServiceSpecificError(
            static_cast<int32_t>(Result::UNAVAILABLE));
}

::ndk::ScopedAStatus TunerHidlService::setLna(bool bEnable) {
    if (mTuner == nullptr) {
        ALOGE("get ITuner failed");
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ public:
    ::ndk::ScopedAStatus openSharedFilter(const string& in_filterToken,
                                          const shared_ptr<ITunerFilterCallback>& in_cb,
                                          shared_ptr<ITunerFilter>* _aidl_return) override;
    ::ndk::ScopedAStatus isLnaSupported(bool* _aidl_return) override;
    ::ndk::ScopedAStatus setLna(bool in_bEnable) override;
    ::ndk::ScopedAStatus setMaxNumberOfFrontends(FrontendType in_frontendType,
                                                 int32_t in_maxNumber) override;