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

Commit 5195c2f1 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Automerger Merge Worker
Browse files

libaudiohal@aidl: Remove non-working code for HAL PIDs retrieval am:...

libaudiohal@aidl: Remove non-working code for HAL PIDs retrieval am: db666111 am: 5890b5ad am: 59b79c40

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2863906



Change-Id: I886cca3371bf652cce9d2026d787d5e0c85d74e5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b54df5c3 59b79c40
Loading
Loading
Loading
Loading
+3 −18
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@

#include <aidl/android/hardware/audio/core/IModule.h>
#include <android/binder_manager.h>
#include <binder/IServiceManager.h>
#include <media/AidlConversionNdkCpp.h>
#include <media/AidlConversionUtil.h>
#include <utils/Log.h>
@@ -119,23 +118,9 @@ status_t DevicesFactoryHalAidl::getHalPids(std::vector<pid_t> *pids) {
    if (pids == nullptr) {
        return BAD_VALUE;
    }
    // The functionality for retrieving debug infos of services is not exposed via the NDK.
    sp<IServiceManager> sm = defaultServiceManager();
    if (sm == nullptr) {
        return NO_INIT;
    }
    std::set<pid_t> pidsSet;
    const auto moduleServiceName = std::string(IModule::descriptor) + "/";
    auto debugInfos = sm->getServiceDebugInfo();
    for (const auto& info : debugInfos) {
        if (info.pid > 0 &&
                info.name.size() > moduleServiceName.size() && // '>' as there must be instance name
                info.name.substr(0, moduleServiceName.size()) == moduleServiceName) {
            pidsSet.insert(info.pid);
        }
    }
    *pids = {pidsSet.begin(), pidsSet.end()};
    return NO_ERROR;
    // Retrieval of HAL pids requires "list services" permission which is not granted
    // to the audio server. This job is performed by AudioService (in Java) instead.
    return PERMISSION_DENIED;
}

status_t DevicesFactoryHalAidl::setCallbackOnce(sp<DevicesFactoryHalCallback> callback) {