From 1563d6546cd1d329c6ee64288f1915e9fd284ea9 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Mon, 7 Dec 2015 17:40:04 -0800 Subject: [PATCH] Remove property_area_initialized This is deadcode as property_init() will only ever be called once and the only remaining caller of properties_initialized() is Service::NotifyStateChange() which can only be called after properties have been initialized. Change-Id: Ie071af84fcdbead72d259890fc8fb8db624282e7 --- init/property_service.cpp | 11 ----------- init/property_service.h | 3 +-- init/service.cpp | 5 ----- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/init/property_service.cpp b/init/property_service.cpp index 7d32a44b4..806608ed5 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -60,17 +60,10 @@ #define RECOVERY_MOUNT_POINT "/recovery" static int persistent_properties_loaded = 0; -static bool property_area_initialized = false; static int property_set_fd = -1; void property_init() { - if (property_area_initialized) { - return; - } - - property_area_initialized = true; - if (__system_property_area_init()) { ERROR("Failed to initialize property area\n"); exit(1); @@ -478,10 +471,6 @@ void property_load_boot_defaults() { load_properties_from_file(PROP_PATH_RAMDISK_DEFAULT, NULL); } -bool properties_initialized() { - return property_area_initialized; -} - static void load_override_properties() { if (ALLOW_LOCAL_PROP_OVERRIDE) { std::string debuggable = property_get("ro.debuggable"); diff --git a/init/property_service.h b/init/property_service.h index b662978e1..dbaed345c 100644 --- a/init/property_service.h +++ b/init/property_service.h @@ -34,7 +34,6 @@ extern void load_system_props(void); extern void start_property_service(void); std::string property_get(const char* name); extern int property_set(const char *name, const char *value); -extern bool properties_initialized(); -#endif /* _INIT_PROPERTY_H */ +#endif /* _INIT_PROPERTY_H */ diff --git a/init/service.cpp b/init/service.cpp index e78787b95..40a4bc7db 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -76,11 +76,6 @@ Service::Service(const std::string& name, const std::string& classname, } void Service::NotifyStateChange(const std::string& new_state) const { - if (!properties_initialized()) { - // If properties aren't available yet, we can't set them. - return; - } - if ((flags_ & SVC_EXEC) != 0) { // 'exec' commands don't have properties tracking their state. return;