1 /* 2 * Copyright (C) 2020 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 #include <android/frameworks/stats/1.0/IStats.h> 18 #include <android/frameworks/stats/1.0/types.h> 19 20 using namespace android::frameworks::stats::V1_0; 21 22 namespace android { 23 namespace frameworks { 24 namespace stats { 25 namespace V1_0 { 26 namespace implementation { 27 28 using android::hardware::Return; 29 30 /** 31 * Implements the Stats HAL 32 */ 33 class StatsHal : public IStats { 34 public: 35 StatsHal(); 36 37 /** 38 * Binder call to get SpeakerImpedance atom. 39 */ 40 virtual Return<void> reportSpeakerImpedance(const SpeakerImpedance& speakerImpedance) override; 41 42 /** 43 * Binder call to get HardwareFailed atom. 44 */ 45 virtual Return<void> reportHardwareFailed(const HardwareFailed& hardwareFailed) override; 46 47 /** 48 * Binder call to get PhysicalDropDetected atom. 49 */ 50 virtual Return<void> reportPhysicalDropDetected( 51 const PhysicalDropDetected& physicalDropDetected) override; 52 53 /** 54 * Binder call to get ChargeCyclesReported atom. 55 */ 56 virtual Return<void> reportChargeCycles(const ChargeCycles& chargeCycles) override; 57 58 /** 59 * Binder call to get BatteryHealthSnapshot atom. 60 */ 61 virtual Return<void> reportBatteryHealthSnapshot( 62 const BatteryHealthSnapshotArgs& batteryHealthSnapshotArgs) override; 63 64 /** 65 * Binder call to get SlowIo atom. 66 */ 67 virtual Return<void> reportSlowIo(const SlowIo& slowIo) override; 68 69 /** 70 * Binder call to get BatteryCausedShutdown atom. 71 */ 72 virtual Return<void> reportBatteryCausedShutdown( 73 const BatteryCausedShutdown& batteryCausedShutdown) override; 74 75 /** 76 * Binder call to get UsbPortOverheatEvent atom. 77 */ 78 virtual Return<void> reportUsbPortOverheatEvent( 79 const UsbPortOverheatEvent& usbPortOverheatEvent) override; 80 81 /** 82 * Binder call to get Speech DSP state atom. 83 */ 84 virtual Return<void> reportSpeechDspStat( 85 const SpeechDspStat& speechDspStat) override; 86 87 /** 88 * Binder call to get vendor atom. 89 */ 90 virtual Return<void> reportVendorAtom(const VendorAtom& vendorAtom) override; 91 }; 92 93 } // namespace implementation 94 } // namespace V1_0 95 } // namespace stats 96 } // namespace frameworks 97 } // namespace android 98