init: delay 'user root' test to W+
We'll make it a build time check in V after this.
Due to being a runtime flog, it was hard to spot and
debug, so delaying.
Bug: 340953047
Test: boot, CtsInitTestCases
Change-Id: Ica1a1c780e230c88615dad7937404d2b0fe9c68f
diff --git a/init/service_parser.cpp b/init/service_parser.cpp
index 92e350b..6f3e368 100644
--- a/init/service_parser.cpp
+++ b/init/service_parser.cpp
@@ -680,12 +680,12 @@
}
if (service_->proc_attr_.parsed_uid == std::nullopt) {
- if (android::base::GetIntProperty("ro.vendor.api_level", 0) > __ANDROID_API_U__) {
+ if (android::base::GetIntProperty("ro.vendor.api_level", 0) > __ANDROID_API_V__) {
return Error() << "No user specified for service '" << service_->name()
- << "'. Defaults to root.";
+ << "', so it would have been root.";
} else {
LOG(WARNING) << "No user specified for service '" << service_->name()
- << "'. Defaults to root.";
+ << "', so it is root.";
}
}