1 /* 2 * Copyright (C) 2008 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 package com.android.internal.app; 18 19 import com.android.internal.os.BatteryStatsImpl; 20 21 import android.os.WorkSource; 22 import android.telephony.SignalStrength; 23 24 interface IBatteryStats { getStatistics()25 byte[] getStatistics(); noteStartWakelock(int uid, int pid, String name, int type)26 void noteStartWakelock(int uid, int pid, String name, int type); noteStopWakelock(int uid, int pid, String name, int type)27 void noteStopWakelock(int uid, int pid, String name, int type); 28 29 /* DO NOT CHANGE the position of noteStartSensor without updating 30 SensorService.cpp */ noteStartSensor(int uid, int sensor)31 void noteStartSensor(int uid, int sensor); 32 33 /* DO NOT CHANGE the position of noteStopSensor without updating 34 SensorService.cpp */ noteStopSensor(int uid, int sensor)35 void noteStopSensor(int uid, int sensor); 36 noteStartWakelockFromSource(in WorkSource ws, int pid, String name, int type)37 void noteStartWakelockFromSource(in WorkSource ws, int pid, String name, int type); noteStopWakelockFromSource(in WorkSource ws, int pid, String name, int type)38 void noteStopWakelockFromSource(in WorkSource ws, int pid, String name, int type); 39 noteVibratorOn(int uid, long durationMillis)40 void noteVibratorOn(int uid, long durationMillis); noteVibratorOff(int uid)41 void noteVibratorOff(int uid); noteStartGps(int uid)42 void noteStartGps(int uid); noteStopGps(int uid)43 void noteStopGps(int uid); noteScreenOn()44 void noteScreenOn(); noteScreenBrightness(int brightness)45 void noteScreenBrightness(int brightness); noteScreenOff()46 void noteScreenOff(); noteInputEvent()47 void noteInputEvent(); noteUserActivity(int uid, int event)48 void noteUserActivity(int uid, int event); notePhoneOn()49 void notePhoneOn(); notePhoneOff()50 void notePhoneOff(); notePhoneSignalStrength(in SignalStrength signalStrength)51 void notePhoneSignalStrength(in SignalStrength signalStrength); notePhoneDataConnectionState(int dataType, boolean hasData)52 void notePhoneDataConnectionState(int dataType, boolean hasData); notePhoneState(int phoneState)53 void notePhoneState(int phoneState); noteWifiOn()54 void noteWifiOn(); noteWifiOff()55 void noteWifiOff(); noteWifiRunning(in WorkSource ws)56 void noteWifiRunning(in WorkSource ws); noteWifiRunningChanged(in WorkSource oldWs, in WorkSource newWs)57 void noteWifiRunningChanged(in WorkSource oldWs, in WorkSource newWs); noteWifiStopped(in WorkSource ws)58 void noteWifiStopped(in WorkSource ws); noteBluetoothOn()59 void noteBluetoothOn(); noteBluetoothOff()60 void noteBluetoothOff(); noteFullWifiLockAcquired(int uid)61 void noteFullWifiLockAcquired(int uid); noteFullWifiLockReleased(int uid)62 void noteFullWifiLockReleased(int uid); noteWifiScanStarted(int uid)63 void noteWifiScanStarted(int uid); noteWifiScanStopped(int uid)64 void noteWifiScanStopped(int uid); noteWifiMulticastEnabled(int uid)65 void noteWifiMulticastEnabled(int uid); noteWifiMulticastDisabled(int uid)66 void noteWifiMulticastDisabled(int uid); noteFullWifiLockAcquiredFromSource(in WorkSource ws)67 void noteFullWifiLockAcquiredFromSource(in WorkSource ws); noteFullWifiLockReleasedFromSource(in WorkSource ws)68 void noteFullWifiLockReleasedFromSource(in WorkSource ws); noteWifiScanStartedFromSource(in WorkSource ws)69 void noteWifiScanStartedFromSource(in WorkSource ws); noteWifiScanStoppedFromSource(in WorkSource ws)70 void noteWifiScanStoppedFromSource(in WorkSource ws); noteWifiMulticastEnabledFromSource(in WorkSource ws)71 void noteWifiMulticastEnabledFromSource(in WorkSource ws); noteWifiMulticastDisabledFromSource(in WorkSource ws)72 void noteWifiMulticastDisabledFromSource(in WorkSource ws); noteNetworkInterfaceType(String iface, int type)73 void noteNetworkInterfaceType(String iface, int type); setBatteryState(int status, int health, int plugType, int level, int temp, int volt)74 void setBatteryState(int status, int health, int plugType, int level, int temp, int volt); getAwakeTimeBattery()75 long getAwakeTimeBattery(); getAwakeTimePlugged()76 long getAwakeTimePlugged(); 77 } 78