• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #define LOG_TAG "android.hardware.health@2.0-service.cuttlefish"
17 
18 #include <health2/Health.h>
19 #include <health2/service.h>
20 #include <healthd/healthd.h>
21 
22 #include <android-base/logging.h>
23 
24 using android::hardware::health::V2_0::DiskStats;
25 using android::hardware::health::V2_0::StorageInfo;
26 
healthd_board_init(struct healthd_config *)27 void healthd_board_init(struct healthd_config*) {}
28 
healthd_board_battery_update(struct android::BatteryProperties * battery_props)29 int healthd_board_battery_update(
30     struct android::BatteryProperties* battery_props) {
31   battery_props->chargerAcOnline = true;
32   battery_props->chargerUsbOnline = true;
33   battery_props->chargerWirelessOnline = false;
34   battery_props->maxChargingCurrent = 500000;
35   battery_props->maxChargingVoltage = 5000000;
36   battery_props->batteryStatus = android::BATTERY_STATUS_CHARGING;
37   battery_props->batteryHealth = android::BATTERY_HEALTH_GOOD;
38   battery_props->batteryPresent = true;
39   battery_props->batteryLevel = 85;
40   battery_props->batteryVoltage = 3600;
41   battery_props->batteryTemperature = 350;
42   battery_props->batteryCurrent = 400000;
43   battery_props->batteryCycleCount = 32;
44   battery_props->batteryFullCharge = 4000000;
45   battery_props->batteryChargeCounter = 1900000;
46   battery_props->batteryTechnology = "Li-ion";
47   return 0;
48 }
49 
get_storage_info(std::vector<struct StorageInfo> &)50 void get_storage_info(std::vector<struct StorageInfo>&) {}
51 
get_disk_stats(std::vector<struct DiskStats> &)52 void get_disk_stats(std::vector<struct DiskStats>&) {}
53 
main(void)54 int main(void) { return health_service_main(); }
55