IBatteryStats.aidl revision 10eaa8574bb220e7dddf9a78057f83dc64ee5687
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    void noteStartVideo(int uid);
31    void noteStopVideo(int uid);
32    void noteStartAudio(int uid);
33    void noteStopAudio(int uid);
34    void noteResetVideo();
35    void noteResetAudio();
36
37    // Remaining methods are only used in Java.
38    byte[] getStatistics();
39
40    // Return the computed amount of time remaining on battery, in milliseconds.
41    // Returns -1 if nothing could be computed.
42    long computeBatteryTimeRemaining();
43
44    // Return the computed amount of time remaining to fully charge, in milliseconds.
45    // Returns -1 if nothing could be computed.
46    long computeChargeTimeRemaining();
47
48    void addIsolatedUid(int isolatedUid, int appUid);
49    void removeIsolatedUid(int isolatedUid, int appUid);
50
51    void noteEvent(int code, String name, int uid);
52
53    void noteProcessStart(String name, int uid);
54    void noteProcessState(String name, int uid, int state);
55    void noteProcessFinish(String name, int uid);
56    void noteSyncStart(String name, int uid);
57    void noteSyncFinish(String name, int uid);
58    void noteJobStart(String name, int uid);
59    void noteJobFinish(String name, int uid);
60
61    void noteStartWakelock(int uid, int pid, String name, String historyName,
62            int type, boolean unimportantForLogging);
63    void noteStopWakelock(int uid, int pid, String name, String historyName, int type);
64
65    void noteStartWakelockFromSource(in WorkSource ws, int pid, String name, String historyName,
66            int type, boolean unimportantForLogging);
67    void noteChangeWakelockFromSource(in WorkSource ws, int pid, String name, String histyoryName,
68            int type, in WorkSource newWs, int newPid, String newName,
69            String newHistoryName, int newType, boolean newUnimportantForLogging);
70    void noteStopWakelockFromSource(in WorkSource ws, int pid, String name, String historyName,
71            int type);
72
73    void noteVibratorOn(int uid, long durationMillis);
74    void noteVibratorOff(int uid);
75    void noteFlashlightOn();
76    void noteFlashlightOff();
77    void noteStartGps(int uid);
78    void noteStopGps(int uid);
79    void noteScreenState(int state);
80    void noteScreenBrightness(int brightness);
81    void noteUserActivity(int uid, int event);
82    void noteInteractive(boolean interactive);
83    void noteMobileRadioPowerState(int powerState, long timestampNs);
84    void notePhoneOn();
85    void notePhoneOff();
86    void notePhoneSignalStrength(in SignalStrength signalStrength);
87    void notePhoneDataConnectionState(int dataType, boolean hasData);
88    void notePhoneState(int phoneState);
89    void noteWifiOn();
90    void noteWifiOff();
91    void noteWifiRunning(in WorkSource ws);
92    void noteWifiRunningChanged(in WorkSource oldWs, in WorkSource newWs);
93    void noteWifiStopped(in WorkSource ws);
94    void noteWifiState(int wifiState, String accessPoint);
95    void noteWifiSupplicantStateChanged(int supplState, boolean failedAuth);
96    void noteWifiRssiChanged(int newRssi);
97    void noteBluetoothOn();
98    void noteBluetoothOff();
99    void noteBluetoothState(int bluetoothState);
100    void noteFullWifiLockAcquired(int uid);
101    void noteFullWifiLockReleased(int uid);
102    void noteWifiScanStarted(int uid);
103    void noteWifiScanStopped(int uid);
104    void noteWifiMulticastEnabled(int uid);
105    void noteWifiMulticastDisabled(int uid);
106    void noteFullWifiLockAcquiredFromSource(in WorkSource ws);
107    void noteFullWifiLockReleasedFromSource(in WorkSource ws);
108    void noteWifiScanStartedFromSource(in WorkSource ws);
109    void noteWifiScanStoppedFromSource(in WorkSource ws);
110    void noteWifiBatchedScanStartedFromSource(in WorkSource ws, int csph);
111    void noteWifiBatchedScanStoppedFromSource(in WorkSource ws);
112    void noteWifiMulticastEnabledFromSource(in WorkSource ws);
113    void noteWifiMulticastDisabledFromSource(in WorkSource ws);
114    void noteNetworkInterfaceType(String iface, int type);
115    void noteNetworkStatsEnabled();
116    void setBatteryState(int status, int health, int plugType, int level, int temp, int volt);
117    long getAwakeTimeBattery();
118    long getAwakeTimePlugged();
119}
120