The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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 | |
| 17 | package com.android.internal.app; |
| 18 | |
| 19 | import com.android.internal.os.BatteryStatsImpl; |
| 20 | |
Dianne Hackborn | 7e9f4eb | 2010-09-10 18:43:00 -0700 | [diff] [blame] | 21 | import android.os.WorkSource; |
Wink Saville | e9b06d7 | 2009-05-18 21:47:50 -0700 | [diff] [blame] | 22 | import android.telephony.SignalStrength; |
| 23 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | interface IBatteryStats { |
Mike Lockwood | 488bb0e | 2013-09-25 09:27:18 -0700 | [diff] [blame] | 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. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | byte[] getStatistics(); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 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 | |
Dianne Hackborn | 3d658bf | 2014-02-05 13:38:56 -0800 | [diff] [blame] | 38 | void noteStartWakelock(int uid, int pid, String name, int type, boolean unimportantForLogging); |
Dianne Hackborn | 9adb9c3 | 2010-08-13 14:09:56 -0700 | [diff] [blame] | 39 | void noteStopWakelock(int uid, int pid, String name, int type); |
Mathias Agopian | 32123fde | 2010-07-22 22:19:43 -0700 | [diff] [blame] | 40 | |
Dianne Hackborn | 3d658bf | 2014-02-05 13:38:56 -0800 | [diff] [blame] | 41 | void noteStartWakelockFromSource(in WorkSource ws, int pid, String name, int type, |
| 42 | boolean unimportantForLogging); |
Dianne Hackborn | 7e9f4eb | 2010-09-10 18:43:00 -0700 | [diff] [blame] | 43 | void noteStopWakelockFromSource(in WorkSource ws, int pid, String name, int type); |
| 44 | |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 45 | void noteVibratorOn(int uid, long durationMillis); |
| 46 | void noteVibratorOff(int uid); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | void noteStartGps(int uid); |
| 48 | void noteStopGps(int uid); |
| 49 | void noteScreenOn(); |
Dianne Hackborn | 617f877 | 2009-03-31 15:04:46 -0700 | [diff] [blame] | 50 | void noteScreenBrightness(int brightness); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 51 | void noteScreenOff(); |
Dianne Hackborn | 617f877 | 2009-03-31 15:04:46 -0700 | [diff] [blame] | 52 | void noteInputEvent(); |
| 53 | void noteUserActivity(int uid, int event); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | void notePhoneOn(); |
| 55 | void notePhoneOff(); |
Wink Saville | e9b06d7 | 2009-05-18 21:47:50 -0700 | [diff] [blame] | 56 | void notePhoneSignalStrength(in SignalStrength signalStrength); |
Dianne Hackborn | 627bba7 | 2009-03-24 22:32:56 -0700 | [diff] [blame] | 57 | void notePhoneDataConnectionState(int dataType, boolean hasData); |
Amith Yamasani | f37447b | 2009-10-08 18:28:01 -0700 | [diff] [blame] | 58 | void notePhoneState(int phoneState); |
Dianne Hackborn | 58e0eef | 2010-09-16 01:22:10 -0700 | [diff] [blame] | 59 | 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 Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 64 | void noteBluetoothOn(); |
| 65 | void noteBluetoothOff(); |
| 66 | void noteFullWifiLockAcquired(int uid); |
| 67 | void noteFullWifiLockReleased(int uid); |
Nick Pelly | 6ccaa54 | 2012-06-15 15:22:47 -0700 | [diff] [blame] | 68 | void noteWifiScanStarted(int uid); |
| 69 | void noteWifiScanStopped(int uid); |
Robert Greenwalt | 5347bd4 | 2009-05-13 15:10:16 -0700 | [diff] [blame] | 70 | void noteWifiMulticastEnabled(int uid); |
| 71 | void noteWifiMulticastDisabled(int uid); |
Dianne Hackborn | 7e9f4eb | 2010-09-10 18:43:00 -0700 | [diff] [blame] | 72 | void noteFullWifiLockAcquiredFromSource(in WorkSource ws); |
| 73 | void noteFullWifiLockReleasedFromSource(in WorkSource ws); |
Nick Pelly | 6ccaa54 | 2012-06-15 15:22:47 -0700 | [diff] [blame] | 74 | void noteWifiScanStartedFromSource(in WorkSource ws); |
| 75 | void noteWifiScanStoppedFromSource(in WorkSource ws); |
Robert Greenwalt | a029ea1 | 2013-09-25 16:38:12 -0700 | [diff] [blame] | 76 | void noteWifiBatchedScanStartedFromSource(in WorkSource ws, int csph); |
| 77 | void noteWifiBatchedScanStoppedFromSource(in WorkSource ws); |
Dianne Hackborn | 7e9f4eb | 2010-09-10 18:43:00 -0700 | [diff] [blame] | 78 | void noteWifiMulticastEnabledFromSource(in WorkSource ws); |
| 79 | void noteWifiMulticastDisabledFromSource(in WorkSource ws); |
Jeff Sharkey | 1059c3c | 2011-10-04 16:54:49 -0700 | [diff] [blame] | 80 | void noteNetworkInterfaceType(String iface, int type); |
Jeff Sharkey | 7a1c3fc | 2013-06-04 12:29:00 -0700 | [diff] [blame] | 81 | void noteNetworkStatsEnabled(); |
Dianne Hackborn | 6b7b484 | 2010-06-14 17:17:44 -0700 | [diff] [blame] | 82 | void setBatteryState(int status, int health, int plugType, int level, int temp, int volt); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 83 | long getAwakeTimeBattery(); |
| 84 | long getAwakeTimePlugged(); |
| 85 | } |