IBatteryStats.aidl revision abc7c499133fe640d6ece2b28d43b52e66cdaa9a
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 noteStartWakelock(int uid, int pid, String name, String historyName,
48            int type, boolean unimportantForLogging);
49    void noteStopWakelock(int uid, int pid, String name, String historyName, int type);
50
51    void noteStartWakelockFromSource(in WorkSource ws, int pid, String name, String historyName,
52            int type, boolean unimportantForLogging);
53    void noteChangeWakelockFromSource(in WorkSource ws, int pid, String name, String histyoryName,
54            int type, in WorkSource newWs, int newPid, String newName,
55            String newHistoryName, int newType, boolean newUnimportantForLogging);
56    void noteStopWakelockFromSource(in WorkSource ws, int pid, String name, String historyName,
57            int type);
58
59    void noteVibratorOn(int uid, long durationMillis);
60    void noteVibratorOff(int uid);
61    void noteFlashlightOn();
62    void noteFlashlightOff();
63    void noteStartGps(int uid);
64    void noteStopGps(int uid);
65    void noteScreenState(int state);
66    void noteScreenBrightness(int brightness);
67    void noteUserActivity(int uid, int event);
68    void noteInteractive(boolean interactive);
69    void noteMobileRadioPowerState(int powerState, long timestampNs);
70    void notePhoneOn();
71    void notePhoneOff();
72    void notePhoneSignalStrength(in SignalStrength signalStrength);
73    void notePhoneDataConnectionState(int dataType, boolean hasData);
74    void notePhoneState(int phoneState);
75    void noteWifiOn();
76    void noteWifiOff();
77    void noteWifiRunning(in WorkSource ws);
78    void noteWifiRunningChanged(in WorkSource oldWs, in WorkSource newWs);
79    void noteWifiStopped(in WorkSource ws);
80    void noteWifiState(int wifiState, String accessPoint);
81    void noteWifiSupplicantStateChanged(int supplState, boolean failedAuth);
82    void noteWifiRssiChanged(int newRssi);
83    void noteBluetoothOn();
84    void noteBluetoothOff();
85    void noteBluetoothState(int bluetoothState);
86    void noteFullWifiLockAcquired(int uid);
87    void noteFullWifiLockReleased(int uid);
88    void noteWifiScanStarted(int uid);
89    void noteWifiScanStopped(int uid);
90    void noteWifiMulticastEnabled(int uid);
91    void noteWifiMulticastDisabled(int uid);
92    void noteFullWifiLockAcquiredFromSource(in WorkSource ws);
93    void noteFullWifiLockReleasedFromSource(in WorkSource ws);
94    void noteWifiScanStartedFromSource(in WorkSource ws);
95    void noteWifiScanStoppedFromSource(in WorkSource ws);
96    void noteWifiBatchedScanStartedFromSource(in WorkSource ws, int csph);
97    void noteWifiBatchedScanStoppedFromSource(in WorkSource ws);
98    void noteWifiMulticastEnabledFromSource(in WorkSource ws);
99    void noteWifiMulticastDisabledFromSource(in WorkSource ws);
100    void noteNetworkInterfaceType(String iface, int type);
101    void noteNetworkStatsEnabled();
102    void setBatteryState(int status, int health, int plugType, int level, int temp, int volt);
103    long getAwakeTimeBattery();
104    long getAwakeTimePlugged();
105}
106