summaryrefslogtreecommitdiff
path: root/init/service_parser.cpp
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2019-10-16 14:22:12 -0700
committerYifan Hong <elsk@google.com>2019-10-31 18:37:02 -0700
commit8fb7f773f04dc43dd4aff8d05b23ec06023c37b0 (patch)
treedc699689ef2bcf3a8b8a9190cbb8f452598dfd94 /init/service_parser.cpp
parent8578a8a8ec3b28209ba0b9e2d1f1eda39c35f885 (diff)
init: hack for /charger symlink
Legacy symlink from /charger to /system/bin/charger is removed. Instead, all Android R devices are required to use /system/bin/charger instead. See hardware/interfaces/health/2.1/README.md for details. Bug: 142286265 Test: charger mode Change-Id: Ib478a864ef68647bc9fc14650ca3d382952b80c8
Diffstat (limited to 'init/service_parser.cpp')
-rw-r--r--init/service_parser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/init/service_parser.cpp b/init/service_parser.cpp
index e7808a999..e6a341d77 100644
--- a/init/service_parser.cpp
+++ b/init/service_parser.cpp
@@ -560,6 +560,11 @@ Result<void> ServiceParser::ParseSection(std::vector<std::string>&& args,
str_args[0] = "/system/bin/watchdogd";
}
}
+ if (SelinuxGetVendorAndroidVersion() <= __ANDROID_API_Q__) {
+ if (str_args[0] == "/charger") {
+ str_args[0] = "/system/bin/charger";
+ }
+ }
service_ = std::make_unique<Service>(name, restart_action_subcontext, str_args);
return {};