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