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