IBatteryStats.aidl revision cbefd8dd2befcb768f911a63becc427ec4c13250
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 noteStartGps(int uid); 62 void noteStopGps(int uid); 63 void noteScreenState(int state); 64 void noteScreenBrightness(int brightness); 65 void noteUserActivity(int uid, int event); 66 void noteInteractive(boolean interactive); 67 void noteMobileRadioPowerState(int powerState, long timestampNs); 68 void notePhoneOn(); 69 void notePhoneOff(); 70 void notePhoneSignalStrength(in SignalStrength signalStrength); 71 void notePhoneDataConnectionState(int dataType, boolean hasData); 72 void notePhoneState(int phoneState); 73 void noteWifiOn(); 74 void noteWifiOff(); 75 void noteWifiRunning(in WorkSource ws); 76 void noteWifiRunningChanged(in WorkSource oldWs, in WorkSource newWs); 77 void noteWifiStopped(in WorkSource ws); 78 void noteWifiState(int wifiState, String accessPoint); 79 void noteBluetoothOn(); 80 void noteBluetoothOff(); 81 void noteBluetoothState(int bluetoothState); 82 void noteFullWifiLockAcquired(int uid); 83 void noteFullWifiLockReleased(int uid); 84 void noteWifiScanStarted(int uid); 85 void noteWifiScanStopped(int uid); 86 void noteWifiMulticastEnabled(int uid); 87 void noteWifiMulticastDisabled(int uid); 88 void noteFullWifiLockAcquiredFromSource(in WorkSource ws); 89 void noteFullWifiLockReleasedFromSource(in WorkSource ws); 90 void noteWifiScanStartedFromSource(in WorkSource ws); 91 void noteWifiScanStoppedFromSource(in WorkSource ws); 92 void noteWifiBatchedScanStartedFromSource(in WorkSource ws, int csph); 93 void noteWifiBatchedScanStoppedFromSource(in WorkSource ws); 94 void noteWifiMulticastEnabledFromSource(in WorkSource ws); 95 void noteWifiMulticastDisabledFromSource(in WorkSource ws); 96 void noteNetworkInterfaceType(String iface, int type); 97 void noteNetworkStatsEnabled(); 98 void setBatteryState(int status, int health, int plugType, int level, int temp, int volt); 99 long getAwakeTimeBattery(); 100 long getAwakeTimePlugged(); 101} 102