diff --git a/healthd/Android.bp b/healthd/Android.bp index 15f009e93..be3f92087 100644 --- a/healthd/Android.bp +++ b/healthd/Android.bp @@ -106,6 +106,7 @@ sysprop_library { cc_library_static { name: "libhealthd_draw", + vendor_available: true, export_include_dirs: ["."], static_libs: [ "libcharger_sysprop", @@ -117,10 +118,19 @@ cc_library_static { header_libs: ["libbatteryservice_headers"], srcs: ["healthd_draw.cpp"], + + target: { + vendor: { + exclude_static_libs: [ + "libcharger_sysprop", + ], + }, + }, } cc_library_static { name: "libhealthd_charger_ui", + vendor_available: true, export_include_dirs: [ "include", "include_charger", @@ -156,6 +166,14 @@ cc_library_static { "healthd_mode_charger.cpp", "AnimationParser.cpp", ], + + target: { + vendor: { + exclude_static_libs: [ + "libcharger_sysprop", + ], + }, + }, } cc_library_static { diff --git a/healthd/healthd_draw.cpp b/healthd/healthd_draw.cpp index 9a47f6b2b..4484fa61e 100644 --- a/healthd/healthd_draw.cpp +++ b/healthd/healthd_draw.cpp @@ -18,19 +18,30 @@ #include #include -#include "charger.sysprop.h" #include "healthd_draw.h" +#if !defined(__ANDROID_VNDK__) +#include "charger.sysprop.h" +#endif + #define LOGE(x...) KLOG_ERROR("charger", x); #define LOGW(x...) KLOG_WARNING("charger", x); #define LOGV(x...) KLOG_DEBUG("charger", x); static bool get_split_screen() { +#if !defined(__ANDROID_VNDK__) return android::sysprop::ChargerProperties::draw_split_screen().value_or(false); +#else + return false; +#endif } static int get_split_offset() { +#if !defined(__ANDROID_VNDK__) int64_t value = android::sysprop::ChargerProperties::draw_split_offset().value_or(0); +#else + int64_t value = 0; +#endif if (value < static_cast(std::numeric_limits::min())) { LOGW("draw_split_offset = %" PRId64 " overflow for an int; resetting to %d.\n", value, std::numeric_limits::min()); diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp index aac719bab..d40a41a8e 100644 --- a/healthd/healthd_mode_charger.cpp +++ b/healthd/healthd_mode_charger.cpp @@ -50,13 +50,16 @@ #include #include "AnimationParser.h" -#include "charger.sysprop.h" #include "healthd_draw.h" #include #include #include +#if !defined(__ANDROID_VNDK__) +#include "charger.sysprop.h" +#endif + using std::string_literals::operator""s; using namespace android; using aidl::android::hardware::health::BatteryStatus; @@ -314,10 +317,12 @@ void Charger::UpdateScreenState(int64_t now) { healthd_draw_ = HealthdDraw::Create(&batt_anim_); if (healthd_draw_ == nullptr) return; +#if !defined(__ANDROID_VNDK__) if (android::sysprop::ChargerProperties::disable_init_blank().value_or(false)) { healthd_draw_->blank_screen(true); screen_blanked_ = true; } +#endif } /* animation is over, blank screen and leave */