diff options
author | Nick Kralevich <nnk@google.com> | 2012-09-19 13:05:05 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-19 13:05:06 -0700 |
commit | e1df9ad215af6e51a2d8fb1d0306e00c7b510b62 (patch) | |
tree | 1e22df7457e7b84b7e85bdb3ffcca3b892eafe76 | |
parent | 1683413f413eb1b77f527247db2df31eae93ee3a (diff) | |
parent | 32b9023d086e3e22886dd3271f505ef64cd84bc8 (diff) | |
download | system_core-e1df9ad215af6e51a2d8fb1d0306e00c7b510b62.zip system_core-e1df9ad215af6e51a2d8fb1d0306e00c7b510b62.tar.gz system_core-e1df9ad215af6e51a2d8fb1d0306e00c7b510b62.tar.bz2 |
Merge "init: Don't read local properties if ro.debuggable=0" into jb-mr1-dev
-rwxr-xr-x | init/property_service.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/init/property_service.c b/init/property_service.c index c378aeb..f58e07d 100755 --- a/init/property_service.c +++ b/init/property_service.c @@ -582,6 +582,16 @@ int properties_inited(void) return property_area_inited; } +static void load_override_properties() { +#ifdef ALLOW_LOCAL_PROP_OVERRIDE + const char *debuggable = property_get("ro.debuggable"); + if (debuggable && (strcmp(debuggable, "1") == 0)) { + load_properties_from_file(PROP_PATH_LOCAL_OVERRIDE); + } +#endif /* ALLOW_LOCAL_PROP_OVERRIDE */ +} + + /* When booting an encrypted system, /data is not mounted when the * property service is started, so any properties stored there are * not loaded. Vold triggers init to load these properties once it @@ -589,9 +599,7 @@ int properties_inited(void) */ void load_persist_props(void) { -#ifdef ALLOW_LOCAL_PROP_OVERRIDE - load_properties_from_file(PROP_PATH_LOCAL_OVERRIDE); -#endif /* ALLOW_LOCAL_PROP_OVERRIDE */ + load_override_properties(); /* Read persistent properties after all default values have been loaded. */ load_persistent_properties(); } @@ -602,9 +610,7 @@ void start_property_service(void) load_properties_from_file(PROP_PATH_SYSTEM_BUILD); load_properties_from_file(PROP_PATH_SYSTEM_DEFAULT); -#ifdef ALLOW_LOCAL_PROP_OVERRIDE - load_properties_from_file(PROP_PATH_LOCAL_OVERRIDE); -#endif /* ALLOW_LOCAL_PROP_OVERRIDE */ + load_override_properties(); /* Read persistent properties after all default values have been loaded. */ load_persistent_properties(); |