init: check property type in host_init_verifier
We have all of the 'type' information for properties available during
build time, so let's check this when setting properties in init.
Test: setprop apexd.status bad results in:
host_init_verifier: Command 'setprop apexd.status bad'
(out/soong/.intermediates/system/core/rootdir/init.rc/android_x86_core/init.rc:927)
failed: Property type check failed, value doesn't match expected type
'enum starting ready'
host_init_verifier: Failed to parse init script
'out/soong/.intermediates/system/core/rootdir/init.rc/android_x86_core/init.rc'
with 1 errors
Test: CF builds without that error
Change-Id: Iaad07747c09f4a10b2b816c455d6e8a485357ab9
diff --git a/init/Android.bp b/init/Android.bp
index d939fcc..131267b 100644
--- a/init/Android.bp
+++ b/init/Android.bp
@@ -281,6 +281,8 @@
static_libs: [
"libbase",
"libselinux",
+ "libpropertyinfoserializer",
+ "libpropertyinfoparser",
],
whole_static_libs: ["libcap"],
shared_libs: [
@@ -304,6 +306,7 @@
"host_import_parser.cpp",
"host_init_verifier.cpp",
"parser.cpp",
+ "property_type.cpp",
"rlimit_parser.cpp",
"tokenizer.cpp",
"service.cpp",