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 17package android.frameworks.stats@1.0; 18 19/** 20 * IStats is an interface that allows clients to report specific hardware 21 * reliabilty events, which are translated into calls for the client to accept. 22 */ 23interface IStats { 24 25 /** 26 * Report the detected speaker impedance value. 27 * 28 * @param speakerImpedance A SpeakerImpedance struct that holds speaker 29 * location and a detected milli ohms. 30 */ 31 oneway reportSpeakerImpedance(SpeakerImpedance speakerImpedance); 32 33 /** 34 * Report the detected failure of a hardware component. 35 * 36 * @param hardwareFailed A HardwareFailed struct indicating hardware type 37 * that failed, location, and error code. 38 */ 39 oneway reportHardwareFailed(HardwareFailed hardwareFailed); 40 41 /** 42 * Report the detection of a physical drop event, as detected by 43 * accelerometers. 44 * 45 * @param physicalDropDetected A PhysicalDropDetected struct with percentage 46 * confidence that a drop occured, peak detected acceleration, and the 47 * duration of freefall. 48 */ 49 oneway reportPhysicalDropDetected(PhysicalDropDetected physicalDropDetected); 50 51 /** 52 * Report bucketed battery charge cycles. 53 * 54 * @param chargeCycles A struct with battery charge cycle buckets. 55 */ 56 oneway reportChargeCycles(ChargeCycles chargeCycles); 57 58 /** 59 * Report battery health snapshot, aggregated. 60 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level 61 * are snapshotted periodically over 24hrs. 62 * 63 * @param args A BatteryHealthSnapshotArgs struct that contains the above 64 * listed metrics. 65 */ 66 oneway reportBatteryHealthSnapshot(BatteryHealthSnapshotArgs args); 67 68 /** 69 * Report slow I/O operations, aggregated. 70 * 71 * @param slowIo A SlowIo struct holding the type of slow IO operation and 72 * the number of slow IO operations of this type over 24hrs. 73 */ 74 oneway reportSlowIo(SlowIo slowIo); 75 76 /** 77 * Report a shutdown event caused by low battery. 78 * 79 * @param batteryCausedShutdown A BatteryCausedShutdown struct containing 80 * the last recorded battery voltage prior to shutdown. 81 */ 82 oneway reportBatteryCausedShutdown(BatteryCausedShutdown batteryCausedShutdown); 83 84 /** 85 * Report a USB port overheat event. 86 * 87 * @param UsbPortOverheatEvent A UsbPortOverheatEvent struct with port 88 * temperature at USB plug event, max port temperature seen during 89 * overheat, and time between the plug event, trip event and 90 * mitigation cleared event. 91 */ 92 oneway reportUsbPortOverheatEvent(UsbPortOverheatEvent usbPortOverheatEvent); 93 94 /** 95 * Report the Speech DSP state value. 96 * 97 * @param speechDspStat A SpeechDspStat struct that provide 98 * Speech DSP state 99 */ 100 oneway reportSpeechDspStat(SpeechDspStat speechDspStat); 101 102 /** 103 * Report a custom vendor atom. 104 * 105 * @param VendorAtom A VendorAtom struct that specifies the atom ID, field 106 * types, and data from the client that must be logged in statsd. 107 * Whether or not the atom is uploaded must be determined by the 108 * atom ID and server-side configs. 109 */ 110 oneway reportVendorAtom(VendorAtom vendorAtom); 111}; 112