diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-03 00:02:41 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-03 00:02:41 +0000 |
commit | bd013c4b364527afee21f98ae9046ed80ec3892a (patch) | |
tree | cdb52d34d3ea1b2550e3dedb69fc200ee2b99d3c | |
parent | e40d73a7eb19fa17d7496960add25e273d125ca5 (diff) | |
parent | 8c8ff6a358b59588646589583ed2424177428db7 (diff) | |
download | hwservicemanager-simpleperf-release.tar.gz |
Snap for 11400057 from 8c8ff6a358b59588646589583ed2424177428db7 to simpleperf-releasesimpleperf-release
Change-Id: Ibf33cdca94627cf3d1722dcf317e61e6acab854f
-rw-r--r-- | hwservicemanager.rc | 3 | ||||
-rw-r--r-- | service.cpp | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/hwservicemanager.rc b/hwservicemanager.rc index 7ad492b..ce4db63 100644 --- a/hwservicemanager.rc +++ b/hwservicemanager.rc @@ -10,3 +10,6 @@ service hwservicemanager /system/system_ext/bin/hwservicemanager task_profiles ServiceCapacityLow HighPerformance class animation shutdown critical + +on property:hwservicemanager.disabled=true + stop hwservicemanager diff --git a/service.cpp b/service.cpp index 3fc1391..3766bc5 100644 --- a/service.cpp +++ b/service.cpp @@ -26,6 +26,7 @@ #include <cutils/properties.h> #include <hidl/HidlBinderSupport.h> #include <hidl/HidlTransportSupport.h> +#include <hidl/ServiceManagement.h> #include <hidl/Status.h> #include <hwbinder/IPCThreadState.h> #include <hwbinder/ProcessState.h> @@ -145,6 +146,18 @@ int main() { // TODO(b/36424585): make fatal ProcessState::self()->setCallRestriction(ProcessState::CallRestriction::ERROR_IF_NOT_ONEWAY); + if (!android::hardware::isHidlSupported()) { + ALOGI("HIDL is not supported on this device so hwservicemanager is not needed"); + int rc = property_set("hwservicemanager.disabled", "true"); + if (rc) { + LOG_ALWAYS_FATAL("Failed to set \"hwservicemanager.disabled\" (error %d).\"", rc); + } + // wait here for init to see the proprty and shut us down + while (true) { + ALOGW("Waiting on init to shut this process down."); + sleep(10); + } + } sp<ServiceManager> manager = new ServiceManager(); setRequestingSid(manager, true); |