diff options
author | Chao Chen <cchen@cyngn.com> | 2016-02-17 17:24:41 -0800 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2016-02-17 17:39:48 -0800 |
commit | 4ca66c4d62bd1867520ee42c7077503ac8582c10 (patch) | |
tree | cbc91e69c8f446cad5cba976553b64cbef53d211 /healthd | |
parent | d2583c81e7e394fa4304df521c457b77dbe75050 (diff) | |
download | system_core-4ca66c4d62bd1867520ee42c7077503ac8582c10.zip system_core-4ca66c4d62bd1867520ee42c7077503ac8582c10.tar.gz system_core-4ca66c4d62bd1867520ee42c7077503ac8582c10.tar.bz2 |
healthd: Separate power off alarm implementation into MSM specific HAL
* Make the alarm implementation a separate HAL selected by
BOARD_USES_QCOM_HARDWARE.
REF: CYNGNOS-2073
Change-Id: I232c7999ebadff5c4e4e028c9cc2202441509fb7
Diffstat (limited to 'healthd')
-rw-r--r-- | healthd/Android.mk | 12 | ||||
-rw-r--r-- | healthd/healthd_board_default.cpp | 2 | ||||
-rw-r--r-- | healthd/healthd_board_msm.cpp (renamed from healthd/healthd_msm_alarm.cpp) | 30 | ||||
-rw-r--r-- | healthd/healthd_msm.h | 20 |
4 files changed, 39 insertions, 25 deletions
diff --git a/healthd/Android.mk b/healthd/Android.mk index 48d41f1..d1e005e 100644 --- a/healthd/Android.mk +++ b/healthd/Android.mk @@ -3,12 +3,18 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := healthd_board_default.cpp healthd_msm_alarm.cpp +LOCAL_SRC_FILES := healthd_board_default.cpp LOCAL_MODULE := libhealthd.default LOCAL_CFLAGS := -Werror include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) +LOCAL_SRC_FILES := healthd_board_msm.cpp +LOCAL_MODULE := libhealthd.msm +LOCAL_CFLAGS := -Werror +include $(BUILD_STATIC_LIBRARY) + +include $(CLEAR_VARS) LOCAL_SRC_FILES := \ healthd.cpp \ @@ -55,6 +61,10 @@ endif LOCAL_HAL_STATIC_LIBRARIES := libhealthd +ifeq ($(BOARD_USES_QCOM_HARDWARE),true) +BOARD_HAL_STATIC_LIBRARIES ?= libhealthd.msm +endif + # Symlink /charger to /sbin/healthd LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ && rm -f $(TARGET_ROOT_OUT)/charger && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger diff --git a/healthd/healthd_board_default.cpp b/healthd/healthd_board_default.cpp index cf5479a..c511c9c 100644 --- a/healthd/healthd_board_default.cpp +++ b/healthd/healthd_board_default.cpp @@ -15,12 +15,10 @@ */ #include <healthd.h> -#include "healthd_msm.h" void healthd_board_init(struct healthd_config*) { // use defaults - power_off_alarm_init(); } diff --git a/healthd/healthd_msm_alarm.cpp b/healthd/healthd_board_msm.cpp index cbe809a..1d62507 100644 --- a/healthd/healthd_msm_alarm.cpp +++ b/healthd/healthd_board_msm.cpp @@ -34,7 +34,7 @@ #include <linux/android_alarm.h> #include <linux/rtc.h> -#include "healthd_msm.h" +#include <healthd.h> #define LOGE(x...) do { KLOG_ERROR("charger", x); } while (0) #define LOGI(x...) do { KLOG_INFO("charger", x); } while (0) @@ -201,7 +201,7 @@ err: return NULL; } -void power_off_alarm_init(void) +void healthd_board_init(struct healthd_config*) { pthread_t tid; int rc; @@ -214,3 +214,29 @@ void power_off_alarm_init(void) LOGE("Create alarm thread failed\n"); } } + +int healthd_board_battery_update(struct android::BatteryProperties*) +{ + // return 0 to log periodic polled battery status to kernel log + return 1; +} + +void healthd_board_mode_charger_draw_battery(struct android::BatteryProperties*) +{ + +} + +void healthd_board_mode_charger_battery_update(struct android::BatteryProperties*) +{ + +} + +void healthd_board_mode_charger_set_backlight(bool) +{ + +} + +void healthd_board_mode_charger_init() +{ + +} diff --git a/healthd/healthd_msm.h b/healthd/healthd_msm.h deleted file mode 100644 index 6c46b20..0000000 --- a/healthd/healthd_msm.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2014 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. - */ - -#ifndef _HEALTHD_MSM_H_ -#define _HEALTHD_MSM_H_ -void power_off_alarm_init(void); -#endif /* _HEALTHD_MSM_H_ */ |