blob: 9a047607d9ff7c6e920023687ec9f6db4ba1dea7 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
Dianne Hackborn7e9f4eb2010-09-10 18:43:00 -070021import android.os.WorkSource;
Wink Savillee9b06d72009-05-18 21:47:50 -070022import android.telephony.SignalStrength;
23
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024interface IBatteryStats {
Mike Lockwood488bb0e2013-09-25 09:27:18 -070025 // 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.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031 byte[] getStatistics();
Dianne Hackborn099bc622014-01-22 13:39:16 -080032
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
Dianne Hackborn3d658bf2014-02-05 13:38:56 -080038 void noteStartWakelock(int uid, int pid, String name, int type, boolean unimportantForLogging);
Dianne Hackborn9adb9c32010-08-13 14:09:56 -070039 void noteStopWakelock(int uid, int pid, String name, int type);
Mathias Agopian32123fde2010-07-22 22:19:43 -070040
Dianne Hackborn3d658bf2014-02-05 13:38:56 -080041 void noteStartWakelockFromSource(in WorkSource ws, int pid, String name, int type,
42 boolean unimportantForLogging);
Dianne Hackborn7e9f4eb2010-09-10 18:43:00 -070043 void noteStopWakelockFromSource(in WorkSource ws, int pid, String name, int type);
44
Dianne Hackborna06de0f2012-12-11 16:34:47 -080045 void noteVibratorOn(int uid, long durationMillis);
46 void noteVibratorOff(int uid);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047 void noteStartGps(int uid);
48 void noteStopGps(int uid);
49 void noteScreenOn();
Dianne Hackborn617f8772009-03-31 15:04:46 -070050 void noteScreenBrightness(int brightness);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051 void noteScreenOff();
Dianne Hackborn617f8772009-03-31 15:04:46 -070052 void noteInputEvent();
53 void noteUserActivity(int uid, int event);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054 void notePhoneOn();
55 void notePhoneOff();
Wink Savillee9b06d72009-05-18 21:47:50 -070056 void notePhoneSignalStrength(in SignalStrength signalStrength);
Dianne Hackborn627bba72009-03-24 22:32:56 -070057 void notePhoneDataConnectionState(int dataType, boolean hasData);
Amith Yamasanif37447b2009-10-08 18:28:01 -070058 void notePhoneState(int phoneState);
Dianne Hackborn58e0eef2010-09-16 01:22:10 -070059 void noteWifiOn();
60 void noteWifiOff();
61 void noteWifiRunning(in WorkSource ws);
62 void noteWifiRunningChanged(in WorkSource oldWs, in WorkSource newWs);
63 void noteWifiStopped(in WorkSource ws);
The Android Open Source Project10592532009-03-18 17:39:46 -070064 void noteBluetoothOn();
65 void noteBluetoothOff();
66 void noteFullWifiLockAcquired(int uid);
67 void noteFullWifiLockReleased(int uid);
Nick Pelly6ccaa542012-06-15 15:22:47 -070068 void noteWifiScanStarted(int uid);
69 void noteWifiScanStopped(int uid);
Robert Greenwalt5347bd42009-05-13 15:10:16 -070070 void noteWifiMulticastEnabled(int uid);
71 void noteWifiMulticastDisabled(int uid);
Dianne Hackborn7e9f4eb2010-09-10 18:43:00 -070072 void noteFullWifiLockAcquiredFromSource(in WorkSource ws);
73 void noteFullWifiLockReleasedFromSource(in WorkSource ws);
Nick Pelly6ccaa542012-06-15 15:22:47 -070074 void noteWifiScanStartedFromSource(in WorkSource ws);
75 void noteWifiScanStoppedFromSource(in WorkSource ws);
Robert Greenwalta029ea12013-09-25 16:38:12 -070076 void noteWifiBatchedScanStartedFromSource(in WorkSource ws, int csph);
77 void noteWifiBatchedScanStoppedFromSource(in WorkSource ws);
Dianne Hackborn7e9f4eb2010-09-10 18:43:00 -070078 void noteWifiMulticastEnabledFromSource(in WorkSource ws);
79 void noteWifiMulticastDisabledFromSource(in WorkSource ws);
Jeff Sharkey1059c3c2011-10-04 16:54:49 -070080 void noteNetworkInterfaceType(String iface, int type);
Jeff Sharkey7a1c3fc2013-06-04 12:29:00 -070081 void noteNetworkStatsEnabled();
Dianne Hackborn6b7b4842010-06-14 17:17:44 -070082 void setBatteryState(int status, int health, int plugType, int level, int temp, int volt);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080083 long getAwakeTimeBattery();
84 long getAwakeTimePlugged();
85}