Merge "init: 'user root' check use vendor API" into main am: 0b64326377 am: ee8cbde0d5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3106173
Change-Id: I893dea55ae90d0c62f8fe05d38cfe66d7b97d4a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/init/host_init_stubs.h b/init/host_init_stubs.h
index 2fef9d3..753ed6b 100644
--- a/init/host_init_stubs.h
+++ b/init/host_init_stubs.h
@@ -32,7 +32,6 @@
#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
diff --git a/init/init_test.cpp b/init/init_test.cpp
index b2f586b..5088273 100644
--- a/init/init_test.cpp
+++ b/init/init_test.cpp
@@ -630,7 +630,7 @@
ASSERT_TRUE(parser.ParseConfig(tf.path));
- if (GetIntProperty("ro.vendor.api_level", 0) > __ANDROID_API_V__) {
+ if (GetIntProperty("ro.vendor.api_level", 0) > 202404) {
ASSERT_EQ(1u, parser.parse_error_count());
} else {
ASSERT_EQ(0u, parser.parse_error_count());
diff --git a/init/service_parser.cpp b/init/service_parser.cpp
index 6f3e368..de902e6 100644
--- a/init/service_parser.cpp
+++ b/init/service_parser.cpp
@@ -680,7 +680,7 @@
}
if (service_->proc_attr_.parsed_uid == std::nullopt) {
- if (android::base::GetIntProperty("ro.vendor.api_level", 0) > __ANDROID_API_V__) {
+ if (android::base::GetIntProperty("ro.vendor.api_level", 0) > 202404) {
return Error() << "No user specified for service '" << service_->name()
<< "', so it would have been root.";
} else {