summaryrefslogtreecommitdiff
authorChunjian Zheng <chunjian.zheng@amlogic.com>2014-12-15 07:30:52 (GMT)
committer Chunjian zheng <chunjian.zheng@amlogic.com>2014-12-16 03:19:56 (GMT)
commit82fcfc3b7389cfe1de0e5b66cff77c5d654d49d8 (patch)
tree51af4a7b36b8a8c197d2c066305eb2563b279a00
parenta5d1ee333eefe8caddde8f9058b971103b08419b (diff)
downloadsystem-82fcfc3b7389cfe1de0e5b66cff77c5d654d49d8.zip
system-82fcfc3b7389cfe1de0e5b66cff77c5d654d49d8.tar.gz
system-82fcfc3b7389cfe1de0e5b66cff77c5d654d49d8.tar.bz2
add tablet board libhealthd
Change-Id: Ief22483070dfac3ed1444f7330194e051c3cab4c
Diffstat
-rw-r--r--libhealthd/Android.mk7
-rwxr-xr-xlibhealthd/healthd_board_tablet_default.cpp42
2 files changed, 49 insertions, 0 deletions
diff --git a/libhealthd/Android.mk b/libhealthd/Android.mk
index f3a5522..eb14d93 100644
--- a/libhealthd/Android.mk
+++ b/libhealthd/Android.mk
@@ -11,4 +11,11 @@ LOCAL_C_INCLUDES := system/core/healthd
LOCAL_CFLAGS := -Werror
include $(BUILD_STATIC_LIBRARY)
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := healthd_board_tablet_default.cpp
+LOCAL_MODULE := libhealthd.tablet
+LOCAL_C_INCLUDES := system/core/healthd
+LOCAL_CFLAGS := -Werror
+include $(BUILD_STATIC_LIBRARY)
+
endif
diff --git a/libhealthd/healthd_board_tablet_default.cpp b/libhealthd/healthd_board_tablet_default.cpp
new file mode 100755
index 0000000..527f7fe
--- a/dev/null
+++ b/libhealthd/healthd_board_tablet_default.cpp
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <healthd.h>
+#include <utils/Log.h>
+
+void healthd_board_init(struct healthd_config*)
+{
+ // use defaults
+}
+
+
+int healthd_board_battery_update(struct android::BatteryProperties *props )
+{
+ char dmesgline[256];
+ snprintf(dmesgline, sizeof(dmesgline),
+ "battery l=%d v=%d t=%s%d.%d h=%d st=%d",
+ props->batteryLevel, props->batteryVoltage,
+ props->batteryTemperature < 0 ? "-" : "",
+ abs(props->batteryTemperature / 10),
+ abs(props->batteryTemperature % 10), props->batteryHealth,
+ props->batteryStatus);
+ ALOGI(LOG_TAG, "%s chg=%s%s%s\n", dmesgline,
+ props->chargerAcOnline ? "a" : "",
+ props->chargerUsbOnline ? "u" : "",
+ props->chargerWirelessOnline ? "w" : "");
+ // return 0 to log periodic polled battery status to kernel log
+ return 1;
+}