healthd: charger use runtime sysprops instead.

Bug: 124118169
Test: run off-mode charging
Change-Id: Ib71f84f1c93d1566f4e3101920d98b1d39184390
diff --git a/healthd/Android.mk b/healthd/Android.mk
index d18f15a..289afe9 100644
--- a/healthd/Android.mk
+++ b/healthd/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := libhealthd_draw
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_STATIC_LIBRARIES := libminui
+LOCAL_STATIC_LIBRARIES := libcharger_sysprop libminui
 LOCAL_SHARED_LIBRARIES := libbase
 LOCAL_SRC_FILES := healthd_draw.cpp
 
@@ -52,6 +52,7 @@
 LOCAL_STATIC_LIBRARIES := \
     android.hardware.health@2.0-impl \
     android.hardware.health@1.0-convert \
+    libcharger_sysprop \
     libhealthstoragedefault \
     libhealthd_draw \
     libminui \
@@ -83,14 +84,12 @@
 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
 
 LOCAL_CFLAGS := -Werror
-ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
-LOCAL_CFLAGS += -DCHARGER_NO_UI
-endif
 
 CHARGER_STATIC_LIBRARIES := \
     android.hardware.health@2.0-impl \
     android.hardware.health@1.0-convert \
     libbinderthreadstate \
+    libcharger_sysprop \
     libhidltransport \
     libhidlbase \
     libhwbinder_noltopgo \
@@ -141,8 +140,7 @@
 LOCAL_MODULE_STEM := charger
 
 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
-LOCAL_CFLAGS := -Wall -Werror
-LOCAL_CFLAGS += -DCHARGER_NO_UI
+LOCAL_CFLAGS := -Wall -Werror -DCHARGER_FORCE_NO_UI=1
 
 # charger.recovery doesn't link against libhealthd_{charger,draw} or libminui, since it doesn't need
 # any UI support.
@@ -150,6 +148,7 @@
     android.hardware.health@2.0-impl \
     android.hardware.health@1.0-convert \
     libbinderthreadstate \
+    libcharger_sysprop \
     libhidltransport \
     libhidlbase \
     libhwbinder_noltopgo \
@@ -176,7 +175,7 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE := charger_test
 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
-LOCAL_CFLAGS := -Wall -Werror -DCHARGER_NO_UI
+LOCAL_CFLAGS := -Wall -Werror
 LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
 LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
 LOCAL_SRC_FILES := \