init: do not load default.prop from ramdisk in charger mode

Change-Id: Ic471b891829d7f857674b925c9948954972d9ecb
Signed-off-by: Dima Zavin <dima@android.com>
diff --git a/init/init.c b/init/init.c
index 5058b17..af88f30 100755
--- a/init/init.c
+++ b/init/init.c
@@ -548,8 +548,12 @@
 
 static int property_init_action(int nargs, char **args)
 {
+    bool load_defaults = true;
+
     INFO("property init\n");
-    property_init();
+    if (!strcmp(bootmode, "charger"))
+        load_defaults = false;
+    property_init(load_defaults);
     return 0;
 }
 
diff --git a/init/property_service.c b/init/property_service.c
index 18231e8..6733437 100644
--- a/init/property_service.c
+++ b/init/property_service.c
@@ -505,10 +505,11 @@
     persistent_properties_loaded = 1;
 }
 
-void property_init(void)
+void property_init(bool load_defaults)
 {
     init_property_area();
-    load_properties_from_file(PROP_PATH_RAMDISK_DEFAULT);
+    if (load_defaults)
+        load_properties_from_file(PROP_PATH_RAMDISK_DEFAULT);
 }
 
 int properties_inited(void)
diff --git a/init/property_service.h b/init/property_service.h
index bc97cc4..37c2788 100644
--- a/init/property_service.h
+++ b/init/property_service.h
@@ -17,8 +17,10 @@
 #ifndef _INIT_PROPERTY_H
 #define _INIT_PROPERTY_H
 
+#include <stdbool.h>
+
 extern void handle_property_set_fd(void);
-extern void property_init(void);
+extern void property_init(bool load_defaults);
 extern void load_persist_props(void);
 extern void start_property_service(void);
 void get_property_workspace(int *fd, int *sz);