diff options
author | Nick Kralevich | 2012-09-19 15:05:05 -0500 |
---|---|---|
committer | Android (Google) Code Review | 2012-09-19 15:05:06 -0500 |
commit | e1df9ad215af6e51a2d8fb1d0306e00c7b510b62 (patch) | |
tree | 1e22df7457e7b84b7e85bdb3ffcca3b892eafe76 | |
parent | 1683413f413eb1b77f527247db2df31eae93ee3a (diff) | |
parent | 32b9023d086e3e22886dd3271f505ef64cd84bc8 (diff) | |
download | platform-system-core-e1df9ad215af6e51a2d8fb1d0306e00c7b510b62.tar.gz platform-system-core-e1df9ad215af6e51a2d8fb1d0306e00c7b510b62.tar.xz platform-system-core-e1df9ad215af6e51a2d8fb1d0306e00c7b510b62.zip |
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 c378aeb38..f58e07d86 100755 --- a/init/property_service.c +++ b/init/property_service.c | |||
@@ -582,6 +582,16 @@ int properties_inited(void) | |||
582 | return property_area_inited; | 582 | return property_area_inited; |
583 | } | 583 | } |
584 | 584 | ||
585 | static void load_override_properties() { | ||
586 | #ifdef ALLOW_LOCAL_PROP_OVERRIDE | ||
587 | const char *debuggable = property_get("ro.debuggable"); | ||
588 | if (debuggable && (strcmp(debuggable, "1") == 0)) { | ||
589 | load_properties_from_file(PROP_PATH_LOCAL_OVERRIDE); | ||
590 | } | ||
591 | #endif /* ALLOW_LOCAL_PROP_OVERRIDE */ | ||
592 | } | ||
593 | |||
594 | |||
585 | /* When booting an encrypted system, /data is not mounted when the | 595 | /* When booting an encrypted system, /data is not mounted when the |
586 | * property service is started, so any properties stored there are | 596 | * property service is started, so any properties stored there are |
587 | * not loaded. Vold triggers init to load these properties once it | 597 | * not loaded. Vold triggers init to load these properties once it |
@@ -589,9 +599,7 @@ int properties_inited(void) | |||
589 | */ | 599 | */ |
590 | void load_persist_props(void) | 600 | void load_persist_props(void) |
591 | { | 601 | { |
592 | #ifdef ALLOW_LOCAL_PROP_OVERRIDE | 602 | load_override_properties(); |
593 | load_properties_from_file(PROP_PATH_LOCAL_OVERRIDE); | ||
594 | #endif /* ALLOW_LOCAL_PROP_OVERRIDE */ | ||
595 | /* Read persistent properties after all default values have been loaded. */ | 603 | /* Read persistent properties after all default values have been loaded. */ |
596 | load_persistent_properties(); | 604 | load_persistent_properties(); |
597 | } | 605 | } |
@@ -602,9 +610,7 @@ void start_property_service(void) | |||
602 | 610 | ||
603 | load_properties_from_file(PROP_PATH_SYSTEM_BUILD); | 611 | load_properties_from_file(PROP_PATH_SYSTEM_BUILD); |
604 | load_properties_from_file(PROP_PATH_SYSTEM_DEFAULT); | 612 | load_properties_from_file(PROP_PATH_SYSTEM_DEFAULT); |
605 | #ifdef ALLOW_LOCAL_PROP_OVERRIDE | 613 | load_override_properties(); |
606 | load_properties_from_file(PROP_PATH_LOCAL_OVERRIDE); | ||
607 | #endif /* ALLOW_LOCAL_PROP_OVERRIDE */ | ||
608 | /* Read persistent properties after all default values have been loaded. */ | 614 | /* Read persistent properties after all default values have been loaded. */ |
609 | load_persistent_properties(); | 615 | load_persistent_properties(); |
610 | 616 | ||