Methods Summary |
---|
protected void | dump(java.io.FileDescriptor fd, java.io.PrintWriter pw, java.lang.String[] args)
synchronized (mStats) {
boolean isCheckin = false;
if (args != null) {
for (String arg : args) {
if ("-c".equals(arg)) {
isCheckin = true;
break;
}
}
}
if (isCheckin) mStats.dumpCheckinLocked(pw, args);
else mStats.dumpLocked(new PrintWriterPrinter(pw));
}
|
public void | enforceCallingPermission()
if (Binder.getCallingPid() == Process.myPid()) {
return;
}
mContext.enforcePermission(android.Manifest.permission.UPDATE_DEVICE_STATS,
Binder.getCallingPid(), Binder.getCallingUid(), null);
|
public com.android.internal.os.BatteryStatsImpl | getActiveStatistics()
return mStats;
|
public long | getAwakeTimeBattery()
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.BATTERY_STATS, null);
return mStats.getAwakeTimeBattery();
|
public long | getAwakeTimePlugged()
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.BATTERY_STATS, null);
return mStats.getAwakeTimePlugged();
|
public static com.android.internal.app.IBatteryStats | getService()
if (sService != null) {
return sService;
}
IBinder b = ServiceManager.getService("batteryinfo");
sService = asInterface(b);
return sService;
|
public byte[] | getStatistics()
mContext.enforceCallingPermission(
android.Manifest.permission.BATTERY_STATS, null);
//Log.i("foo", "SENDING BATTERY INFO:");
//mStats.dumpLocked(new LogPrinter(Log.INFO, "foo"));
Parcel out = Parcel.obtain();
mStats.writeToParcel(out, 0);
byte[] data = out.marshall();
out.recycle();
return data;
|
public boolean | isOnBattery()
return mStats.isOnBattery();
|
public void | noteBluetoothOff()
enforceCallingPermission();
synchronized (mStats) {
mStats.noteBluetoothOffLocked();
}
|
public void | noteBluetoothOn()
enforceCallingPermission();
synchronized (mStats) {
mStats.noteBluetoothOnLocked();
}
|
public void | noteFullWifiLockAcquired(int uid)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteFullWifiLockAcquiredLocked(uid);
}
|
public void | noteFullWifiLockReleased(int uid)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteFullWifiLockReleasedLocked(uid);
}
|
public void | noteInputEvent()
enforceCallingPermission();
synchronized (mStats) {
mStats.noteInputEventLocked();
}
|
public void | notePhoneDataConnectionState(int dataType, boolean hasData)
enforceCallingPermission();
synchronized (mStats) {
mStats.notePhoneDataConnectionStateLocked(dataType, hasData);
}
|
public void | notePhoneOff()
enforceCallingPermission();
synchronized (mStats) {
mStats.notePhoneOffLocked();
}
|
public void | notePhoneOn()
enforceCallingPermission();
synchronized (mStats) {
mStats.notePhoneOnLocked();
}
|
public void | notePhoneSignalStrength(int asu)
enforceCallingPermission();
synchronized (mStats) {
mStats.notePhoneSignalStrengthLocked(asu);
}
|
public void | noteScanWifiLockAcquired(int uid)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteScanWifiLockAcquiredLocked(uid);
}
|
public void | noteScanWifiLockReleased(int uid)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteScanWifiLockReleasedLocked(uid);
}
|
public void | noteScreenBrightness(int brightness)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteScreenBrightnessLocked(brightness);
}
|
public void | noteScreenOff()
enforceCallingPermission();
synchronized (mStats) {
mStats.noteScreenOffLocked();
}
|
public void | noteScreenOn()
enforceCallingPermission();
synchronized (mStats) {
mStats.noteScreenOnLocked();
}
|
public void | noteStartGps(int uid)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteStartGps(uid);
}
|
public void | noteStartSensor(int uid, int sensor)
enforceCallingPermission();
synchronized (mStats) {
mStats.getUidStatsLocked(uid).noteStartSensor(sensor);
}
|
public void | noteStartWakelock(int uid, java.lang.String name, int type)
enforceCallingPermission();
synchronized (mStats) {
mStats.getUidStatsLocked(uid).noteStartWakeLocked(name, type);
}
|
public void | noteStopGps(int uid)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteStopGps(uid);
}
|
public void | noteStopSensor(int uid, int sensor)
enforceCallingPermission();
synchronized (mStats) {
mStats.getUidStatsLocked(uid).noteStopSensor(sensor);
}
|
public void | noteStopWakelock(int uid, java.lang.String name, int type)
enforceCallingPermission();
synchronized (mStats) {
mStats.getUidStatsLocked(uid).noteStopWakeLocked(name, type);
}
|
public void | noteUserActivity(int uid, int event)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteUserActivityLocked(uid, event);
}
|
public void | noteWifiOff(int uid)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteWifiOffLocked(uid);
}
|
public void | noteWifiOn(int uid)
enforceCallingPermission();
synchronized (mStats) {
mStats.noteWifiOnLocked(uid);
}
|
public void | noteWifiRunning()
enforceCallingPermission();
synchronized (mStats) {
mStats.noteWifiRunningLocked();
}
|
public void | noteWifiStopped()
enforceCallingPermission();
synchronized (mStats) {
mStats.noteWifiStoppedLocked();
}
|
public void | publish(android.content.Context context)
mContext = context;
ServiceManager.addService("batteryinfo", asBinder());
|
public void | setOnBattery(boolean onBattery, int level)
enforceCallingPermission();
mStats.setOnBattery(onBattery, level);
|