1 /* 2 * Copyright (C) 2021 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 17 #ifndef HARDWARE_GOOGLE_PIXEL_HEALTH_STATSHELPER_H 18 #define HARDWARE_GOOGLE_PIXEL_HEALTH_STATSHELPER_H 19 20 #include <aidl/android/frameworks/stats/IStats.h> 21 22 namespace hardware { 23 namespace google { 24 namespace pixel { 25 namespace health { 26 27 using aidl::android::frameworks::stats::IStats; 28 29 std::shared_ptr<IStats> getStatsService(); 30 31 void reportBatteryHealthSnapshot(const std::shared_ptr<IStats> &stats_client, int32_t type, 32 int32_t temperature_deci_celsius, int32_t voltage_micro_volt, 33 int32_t current_micro_amps, int32_t open_circuit_micro_volt, 34 int32_t resistance_micro_ohm, int32_t level_percent); 35 36 void reportBatteryCausedShutdown(const std::shared_ptr<IStats> &stats_client, 37 int32_t last_recorded_micro_volt); 38 39 } // namespace health 40 } // namespace pixel 41 } // namespace google 42 } // namespace hardware 43 44 #endif // HARDWARE_GOOGLE_PIXEL_HEALTH_STATSHELPER_H 45