Merge "init: delay 'user root' test to W+" into main am: 0d8a598b40

Original change: https://android-review.googlesource.com/c/platform/system/core/+/3095290

Change-Id: Idbe10b3e4a0229b87853fea4d065fe52231dbdd7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2024-05-21 16:05:21 +00:00 committed by Automerger Merge Worker
commit 848cb39248
3 changed files with 5 additions and 4 deletions

View file

@ -32,6 +32,7 @@
#define __ANDROID_API_S__ 31
#define __ANDROID_API_T__ 33
#define __ANDROID_API_U__ 34
#define __ANDROID_API_V__ 35
// sys/system_properties.h
#define PROP_VALUE_MAX 92

View file

@ -630,7 +630,7 @@ service A something
ASSERT_TRUE(parser.ParseConfig(tf.path));
if (GetIntProperty("ro.vendor.api_level", 0) > __ANDROID_API_U__) {
if (GetIntProperty("ro.vendor.api_level", 0) > __ANDROID_API_V__) {
ASSERT_EQ(1u, parser.parse_error_count());
} else {
ASSERT_EQ(0u, parser.parse_error_count());

View file

@ -680,12 +680,12 @@ Result<void> ServiceParser::EndSection() {
}
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.";
}
}