IBatteryStats.aidl revision 2ffa11e4b71c545e34533ef827bdc1a07fbe8246
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 17package com.android.internal.app; 18 19import com.android.internal.os.BatteryStatsImpl; 20 21import android.os.WorkSource; 22import android.telephony.DataConnectionRealTimeInfo; 23import android.telephony.SignalStrength; 24 25interface IBatteryStats { 26 // These first methods are also called by native code, so must 27 // be kept in sync with frameworks/native/include/binder/IBatteryStats.h 28 void noteStartSensor(int uid, int sensor); 29 void noteStopSensor(int uid, int sensor); 30 31 // Remaining methods are only used in Java. 32 byte[] getStatistics(); 33 34 void addIsolatedUid(int isolatedUid, int appUid); 35 void removeIsolatedUid(int isolatedUid, int appUid); 36 37 void noteEvent(int code, String name, int uid); 38 39 void noteStartWakelock(int uid, int pid, String name, String historyName, 40 int type, boolean unimportantForLogging); 41 void noteStopWakelock(int uid, int pid, String name, int type); 42 43 void noteStartWakelockFromSource(in WorkSource ws, int pid, String name, String historyName, 44 int type, boolean unimportantForLogging); 45 void noteChangeWakelockFromSource(in WorkSource ws, int pid, String name, int type, 46 in WorkSource newWs, int newPid, String newName, 47 String newHistoryName, int newType, boolean newUnimportantForLogging); 48 void noteStopWakelockFromSource(in WorkSource ws, int pid, String name, int type); 49 50 void noteVibratorOn(int uid, long durationMillis); 51 void noteVibratorOff(int uid); 52 void noteStartGps(int uid); 53 void noteStopGps(int uid); 54 void noteScreenOn(); 55 void noteScreenBrightness(int brightness); 56 void noteScreenOff(); 57 void noteInputEvent(); 58 void noteUserActivity(int uid, int event); 59 void noteMobileRadioPowerState(int powerState, long timestampNs); 60 void notePhoneOn(); 61 void notePhoneOff(); 62 void notePhoneSignalStrength(in SignalStrength signalStrength); 63 void notePhoneDataConnectionState(int dataType, boolean hasData); 64 void notePhoneState(int phoneState); 65 void noteWifiOn(); 66 void noteWifiOff(); 67 void noteWifiRunning(in WorkSource ws); 68 void noteWifiRunningChanged(in WorkSource oldWs, in WorkSource newWs); 69 void noteWifiStopped(in WorkSource ws); 70 void noteWifiState(int wifiState, String accessPoint); 71 void noteBluetoothOn(); 72 void noteBluetoothOff(); 73 void noteBluetoothState(int bluetoothState); 74 void noteFullWifiLockAcquired(int uid); 75 void noteFullWifiLockReleased(int uid); 76 void noteWifiScanStarted(int uid); 77 void noteWifiScanStopped(int uid); 78 void noteWifiMulticastEnabled(int uid); 79 void noteWifiMulticastDisabled(int uid); 80 void noteFullWifiLockAcquiredFromSource(in WorkSource ws); 81 void noteFullWifiLockReleasedFromSource(in WorkSource ws); 82 void noteWifiScanStartedFromSource(in WorkSource ws); 83 void noteWifiScanStoppedFromSource(in WorkSource ws); 84 void noteWifiBatchedScanStartedFromSource(in WorkSource ws, int csph); 85 void noteWifiBatchedScanStoppedFromSource(in WorkSource ws); 86 void noteWifiMulticastEnabledFromSource(in WorkSource ws); 87 void noteWifiMulticastDisabledFromSource(in WorkSource ws); 88 void noteNetworkInterfaceType(String iface, int type); 89 void noteNetworkStatsEnabled(); 90 void setBatteryState(int status, int health, int plugType, int level, int temp, int volt); 91 long getAwakeTimeBattery(); 92 long getAwakeTimePlugged(); 93} 94