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

Commit 661b2b3d authored by Hongguang Chen's avatar Hongguang Chen Committed by Android (Google) Code Review
Browse files

Merge "Add isLnaSupported API"

parents 241fe0bc a9cb865f
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;