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

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

Merge "Add API to filter out unnecessary PIDs from frontend output."

parents 45b396b7 e106f475
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -46,4 +46,5 @@ interface IFrontend {
  int linkCiCam(in int ciCamId);
  void unlinkCiCam(in int ciCamId);
  String getHardwareInfo();
  void removeOutputPid(int pid);
}
+9 −0
Original line number Diff line number Diff line
@@ -146,4 +146,13 @@ interface IFrontend {
     * @return the frontend hardware information.
     */
    String getHardwareInfo();

    /**
     * Filter out unnecessary PID from frontend output.
     *
     * @param pid specify the PID will be filtered out.
     *
     * @return UNAVAILABLE if the frontend doesn’t support PID filtering out.
     */
    void removeOutputPid(int pid);
}
+7 −0
Original line number Diff line number Diff line
@@ -773,6 +773,13 @@ binder_status_t Frontend::dump(int fd, const char** /* args */, uint32_t /* numA
    return ::ndk::ScopedAStatus::ok();
}

::ndk::ScopedAStatus Frontend::removeOutputPid(int32_t /* in_pid */) {
    ALOGV("%s", __FUNCTION__);

    return ::ndk::ScopedAStatus::fromServiceSpecificError(
            static_cast<int32_t>(Result::UNAVAILABLE));
}

FrontendType Frontend::getFrontendType() {
    return mType;
}
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ class Frontend : public BnFrontend {
    ::ndk::ScopedAStatus linkCiCam(int32_t in_ciCamId, int32_t* _aidl_return) override;
    ::ndk::ScopedAStatus unlinkCiCam(int32_t in_ciCamId) override;
    ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override;
    ::ndk::ScopedAStatus removeOutputPid(int32_t in_pid) override;

    binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;

+8 −0
Original line number Diff line number Diff line
@@ -298,6 +298,13 @@ AssertionResult FrontendTests::linkCiCam(int32_t ciCamId) {
    return AssertionResult(status.isOk());
}

AssertionResult FrontendTests::removeOutputPid(int32_t removePid) {
    ndk::ScopedAStatus status;
    status = mFrontend->removeOutputPid(removePid);
    return AssertionResult(status.isOk() || status.getServiceSpecificError() ==
                                                    static_cast<int32_t>(Result::UNAVAILABLE));
}

AssertionResult FrontendTests::unlinkCiCam(int32_t ciCamId) {
    ndk::ScopedAStatus status = mFrontend->unlinkCiCam(ciCamId);
    return AssertionResult(status.isOk());
@@ -508,6 +515,7 @@ void FrontendTests::tuneTest(FrontendConfig frontendConf) {
    ASSERT_TRUE(setFrontendCallback());
    if (frontendConf.canConnectToCiCam) {
        ASSERT_TRUE(linkCiCam(frontendConf.ciCamId));
        ASSERT_TRUE(removeOutputPid(frontendConf.removePid));
        ASSERT_TRUE(unlinkCiCam(frontendConf.ciCamId));
    }
    ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/));
Loading