charger: make libhealthd_charger_ui vendor_available.
This is a prerequisite to move charger to vendor partition.
Because vendor domains can't read ro.charger.*, they are all assumed
to be the default value. They aren't set in the ecosystem anyway,
so it is time to deprecate them.
Test: builds
Bug: 203246116
Change-Id: I0b17e62ab3ac5a89df091333fd9f24e33bdfd49a
diff --git a/healthd/Android.bp b/healthd/Android.bp
index 15f009e..be3f920 100644
--- a/healthd/Android.bp
+++ b/healthd/Android.bp
@@ -106,6 +106,7 @@
cc_library_static {
name: "libhealthd_draw",
+ vendor_available: true,
export_include_dirs: ["."],
static_libs: [
"libcharger_sysprop",
@@ -117,10 +118,19 @@
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 @@
"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 9a47f6b..4484fa6 100644
--- a/healthd/healthd_draw.cpp
+++ b/healthd/healthd_draw.cpp
@@ -18,19 +18,30 @@
#include <batteryservice/BatteryService.h>
#include <cutils/klog.h>
-#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<int64_t>(std::numeric_limits<int>::min())) {
LOGW("draw_split_offset = %" PRId64 " overflow for an int; resetting to %d.\n", value,
std::numeric_limits<int>::min());
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp
index aac719b..d40a41a 100644
--- a/healthd/healthd_mode_charger.cpp
+++ b/healthd/healthd_mode_charger.cpp
@@ -50,13 +50,16 @@
#include <suspend/autosuspend.h>
#include "AnimationParser.h"
-#include "charger.sysprop.h"
#include "healthd_draw.h"
#include <aidl/android/hardware/health/BatteryStatus.h>
#include <health/HealthLoop.h>
#include <healthd/healthd.h>
+#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 @@
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 */