Merge "Remove non-functioning 'DevicesFactoryHalInterface::getHalPids'" into main
diff --git a/media/libaudiohal/impl/DevicesFactoryHalAidl.cpp b/media/libaudiohal/impl/DevicesFactoryHalAidl.cpp
index 96a3e60..3dbc14a 100644
--- a/media/libaudiohal/impl/DevicesFactoryHalAidl.cpp
+++ b/media/libaudiohal/impl/DevicesFactoryHalAidl.cpp
@@ -114,15 +114,6 @@
return OK;
}
-status_t DevicesFactoryHalAidl::getHalPids(std::vector<pid_t> *pids) {
- if (pids == nullptr) {
- return BAD_VALUE;
- }
- // 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) {
// Dynamic registration of module instances is not supported. The functionality
// in the audio server which is related to this callback can be removed together
diff --git a/media/libaudiohal/impl/DevicesFactoryHalAidl.h b/media/libaudiohal/impl/DevicesFactoryHalAidl.h
index 97e3796..17bfe43 100644
--- a/media/libaudiohal/impl/DevicesFactoryHalAidl.h
+++ b/media/libaudiohal/impl/DevicesFactoryHalAidl.h
@@ -35,8 +35,6 @@
// necessary to release references to the returned object.
status_t openDevice(const char *name, sp<DeviceHalInterface> *device) override;
- status_t getHalPids(std::vector<pid_t> *pids) override;
-
status_t setCallbackOnce(sp<DevicesFactoryHalCallback> callback) override;
android::detail::AudioHalVersionInfo getHalVersion() const override;
diff --git a/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp b/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
index eef60b5..1cac9da 100644
--- a/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
+++ b/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
@@ -163,29 +163,6 @@
return BAD_VALUE;
}
-status_t DevicesFactoryHalHidl::getHalPids(std::vector<pid_t> *pids) {
- std::set<pid_t> pidsSet;
- auto factories = copyDeviceFactories();
- for (const auto& factory : factories) {
- using ::android::hidl::base::V1_0::DebugInfo;
-
- DebugInfo debugInfo;
- auto ret = factory->getDebugInfo([&] (const auto &info) {
- debugInfo = info;
- });
- if (!ret.isOk()) {
- return INVALID_OPERATION;
- }
- if (debugInfo.pid == (int)IServiceManager::PidConstant::NO_PID) {
- continue;
- }
- pidsSet.insert(debugInfo.pid);
- }
-
- *pids = {pidsSet.begin(), pidsSet.end()};
- return NO_ERROR;
-}
-
status_t DevicesFactoryHalHidl::setCallbackOnce(sp<DevicesFactoryHalCallback> callback) {
ALOG_ASSERT(callback != nullptr);
bool needToCallCallback = false;
diff --git a/media/libaudiohal/impl/DevicesFactoryHalHidl.h b/media/libaudiohal/impl/DevicesFactoryHalHidl.h
index 3285af7..e38d86d 100644
--- a/media/libaudiohal/impl/DevicesFactoryHalHidl.h
+++ b/media/libaudiohal/impl/DevicesFactoryHalHidl.h
@@ -43,8 +43,6 @@
// necessary to release references to the returned object.
status_t openDevice(const char *name, sp<DeviceHalInterface> *device) override;
- status_t getHalPids(std::vector<pid_t> *pids) override;
-
status_t setCallbackOnce(sp<DevicesFactoryHalCallback> callback) override;
android::detail::AudioHalVersionInfo getHalVersion() const override;
diff --git a/media/libaudiohal/include/media/audiohal/DevicesFactoryHalInterface.h b/media/libaudiohal/include/media/audiohal/DevicesFactoryHalInterface.h
index 8397e9b..c34a671 100644
--- a/media/libaudiohal/include/media/audiohal/DevicesFactoryHalInterface.h
+++ b/media/libaudiohal/include/media/audiohal/DevicesFactoryHalInterface.h
@@ -42,8 +42,6 @@
// necessary to release references to the returned object.
virtual status_t openDevice(const char *name, sp<DeviceHalInterface> *device) = 0;
- virtual status_t getHalPids(std::vector<pid_t> *pids) = 0;
-
// Sets a DevicesFactoryHalCallback to notify the client.
// The callback can be only set once.
virtual status_t setCallbackOnce(sp<DevicesFactoryHalCallback> callback) = 0;
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 0ebb8ed..403fb9e 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -270,9 +270,6 @@
BatteryNotifier::getInstance().noteResetAudio();
mMediaLogNotifier->run("MediaLogNotifier");
- std::vector<pid_t> halPids;
- mDevicesFactoryHal->getHalPids(&halPids);
- mediautils::TimeCheck::setAudioHalPids(halPids);
// Notify that we have started (also called when audioserver service restarts)
mediametrics::LogItem(mMetricsId)