IBatteryStats.aidl revision 3d658bf20e2d56e36941e7407deebeec1276fbcf
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, int type, boolean unimportantForLogging); 39 void noteStopWakelock(int uid, int pid, String name, int type); 40 41 void noteStartWakelockFromSource(in WorkSource ws, int pid, String name, int type, 42 boolean unimportantForLogging); 43 void noteStopWakelockFromSource(in WorkSource ws, int pid, String name, int type); 44 45 void noteVibratorOn(int uid, long durationMillis); 46 void noteVibratorOff(int uid); 47 void noteStartGps(int uid); 48 void noteStopGps(int uid); 49 void noteScreenOn(); 50 void noteScreenBrightness(int brightness); 51 void noteScreenOff(); 52 void noteInputEvent(); 53 void noteUserActivity(int uid, int event); 54 void notePhoneOn(); 55 void notePhoneOff(); 56 void notePhoneSignalStrength(in SignalStrength signalStrength); 57 void notePhoneDataConnectionState(int dataType, boolean hasData); 58 void notePhoneState(int phoneState); 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); 64 void noteBluetoothOn(); 65 void noteBluetoothOff(); 66 void noteFullWifiLockAcquired(int uid); 67 void noteFullWifiLockReleased(int uid); 68 void noteWifiScanStarted(int uid); 69 void noteWifiScanStopped(int uid); 70 void noteWifiMulticastEnabled(int uid); 71 void noteWifiMulticastDisabled(int uid); 72 void noteFullWifiLockAcquiredFromSource(in WorkSource ws); 73 void noteFullWifiLockReleasedFromSource(in WorkSource ws); 74 void noteWifiScanStartedFromSource(in WorkSource ws); 75 void noteWifiScanStoppedFromSource(in WorkSource ws); 76 void noteWifiBatchedScanStartedFromSource(in WorkSource ws, int csph); 77 void noteWifiBatchedScanStoppedFromSource(in WorkSource ws); 78 void noteWifiMulticastEnabledFromSource(in WorkSource ws); 79 void noteWifiMulticastDisabledFromSource(in WorkSource ws); 80 void noteNetworkInterfaceType(String iface, int type); 81 void noteNetworkStatsEnabled(); 82 void setBatteryState(int status, int health, int plugType, int level, int temp, int volt); 83 long getAwakeTimeBattery(); 84 long getAwakeTimePlugged(); 85} 86