Lines Matching defs:Uid
106 // per uid; once the limit is reached, we batch the remaining wakelocks
152 * Mapping isolated uids to the actual owning app uid.
159 final SparseArray<BatteryStatsImpl.Uid> mUidStats =
160 new SparseArray<BatteryStatsImpl.Uid>();
1221 final Uid mUid;
1238 BatchTimer(Uid uid, int type, TimeBase timeBase, Parcel in) {
1240 mUid = uid;
1246 BatchTimer(Uid uid, int type, TimeBase timeBase) {
1248 mUid = uid;
1353 final Uid mUid;
1379 StopwatchTimer(Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
1382 mUid = uid;
1387 StopwatchTimer(Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
1390 mUid = uid;
1905 tag.uid = mReadHistoryUids[index];
2018 + " " + cur.wakelockTag.uid + ":" + cur.wakelockTag.string);
2025 + " " + cur.wakeReasonTag.uid + ":" + cur.wakeReasonTag.string);
2036 + cur.eventTag.poolIdx + " " + cur.eventTag.uid + ":"
2148 + " " + cur.wakelockTag.uid + ":" + cur.wakelockTag.string);
2156 + " " + cur.wakeReasonTag.uid + ":" + cur.wakeReasonTag.string);
2174 + cur.eventTag.poolIdx + " " + cur.eventTag.uid + ":"
2389 String name, int uid) {
2393 mHistoryCur.eventTag.uid = uid;
2489 public int mapUid(int uid) {
2490 int isolated = mIsolatedUids.get(uid, -1);
2491 return isolated > 0 ? isolated : uid;
2494 public void noteEventLocked(int code, String name, int uid) {
2495 uid = mapUid(uid);
2496 if (!mActiveEvents.updateState(code, name, uid, 0)) {
2501 addHistoryEventLocked(elapsedRealtime, uptime, code, name, uid);
2526 public void noteProcessStartLocked(String name, int uid) {
2527 uid = mapUid(uid);
2529 Uid u = getUidStatsLocked(uid);
2532 if (!mActiveEvents.updateState(HistoryItem.EVENT_PROC_START, name, uid, 0)) {
2540 addHistoryEventLocked(elapsedRealtime, uptime, HistoryItem.EVENT_PROC_START, name, uid);
2543 public void noteProcessStateLocked(String name, int uid, int state) {
2544 uid = mapUid(uid);
2546 getUidStatsLocked(uid).updateProcessStateLocked(name, state, elapsedRealtime);
2549 public void noteProcessFinishLocked(String name, int uid) {
2550 uid = mapUid(uid);
2551 if (!mActiveEvents.updateState(HistoryItem.EVENT_PROC_FINISH, name, uid, 0)) {
2556 getUidStatsLocked(uid).updateProcessStateLocked(name, Uid.PROCESS_STATE_NONE,
2561 addHistoryEventLocked(elapsedRealtime, uptime, HistoryItem.EVENT_PROC_FINISH, name, uid);
2564 uid) {
2565 uid = mapUid(uid);
2568 getUidStatsLocked(uid).noteStartSyncLocked(name, elapsedRealtime);
2569 if (!mActiveEvents.updateState(HistoryItem.EVENT_SYNC_START, name, uid, 0)) {
2572 addHistoryEventLocked(elapsedRealtime, uptime, HistoryItem.EVENT_SYNC_START, name, uid);
2575 public void noteSyncFinishLocked(String name, int uid) {
2576 uid = mapUid(uid);
2579 getUidStatsLocked(uid).noteStopSyncLocked(name, elapsedRealtime);
2580 if (!mActiveEvents.updateState(HistoryItem.EVENT_SYNC_FINISH, name, uid, 0)) {
2583 addHistoryEventLocked(elapsedRealtime, uptime, HistoryItem.EVENT_SYNC_FINISH, name, uid);
2586 public void noteJobStartLocked(String name, int uid) {
2587 uid = mapUid(uid);
2590 getUidStatsLocked(uid).noteStartJobLocked(name, elapsedRealtime);
2591 if (!mActiveEvents.updateState(HistoryItem.EVENT_JOB_START, name, uid, 0)) {
2594 addHistoryEventLocked(elapsedRealtime, uptime, HistoryItem.EVENT_JOB_START, name, uid);
2597 public void noteJobFinishLocked(String name, int uid) {
2598 uid = mapUid(uid);
2601 getUidStatsLocked(uid).noteStopJobLocked(name, elapsedRealtime);
2602 if (!mActiveEvents.updateState(HistoryItem.EVENT_JOB_FINISH, name, uid, 0)) {
2605 addHistoryEventLocked(elapsedRealtime, uptime, HistoryItem.EVENT_JOB_FINISH, name, uid);
2660 public void noteStartWakeLocked(int uid, int pid, String name, String historyName, int type,
2662 uid = mapUid(uid);
2672 uid, 0)) {
2674 HistoryItem.EVENT_WAKE_LOCK_START, historyName, uid);
2683 mHistoryCur.wakelockTag.uid = mInitialAcquireWakeUid = uid;
2693 mHistoryCur.wakelockTag.uid = mInitialAcquireWakeUid = uid;
2700 if (uid >= 0) {
2701 //if (uid == 0) {
2705 getUidStatsLocked(uid).noteStartWakeLocked(pid, name, type, elapsedRealtime);
2709 public void noteStopWakeLocked(int uid, int pid, String name, String historyName, int type,
2711 uid = mapUid(uid);
2719 uid, 0)) {
2721 HistoryItem.EVENT_WAKE_LOCK_FINISH, historyName, uid);
2733 if (uid >= 0) {
2735 getUidStatsLocked(uid).noteStopWakeLocked(pid, name, type, elapsedRealtime);
2797 mHistoryCur.wakeReasonTag.uid = 0;
2824 Uid uid = st.mUid;
2825 // We don't include the system UID, because it so often
2827 if (uid != null && uid.mUid != Process.SYSTEM_UID) {
2843 Uid uid = st.mUid;
2844 // We don't include the system UID, because it so often
2846 if (uid != null && uid.mUid != Process.SYSTEM_UID) {
2855 Uid uid = st.mUid;
2856 if (uid != null && uid.mUid != Process.SYSTEM_UID) {
2862 Uid.Proc proc = uid.getProcessStatsLocked("*wakelock*");
2872 Uid uid = getUidStatsLocked(Process.SYSTEM_UID);
2873 if (uid != null) {
2874 Uid.Proc proc = uid.getProcessStatsLocked("*lost*");
2904 public void noteProcessDiedLocked(int uid, int pid) {
2905 uid = mapUid(uid);
2906 Uid u = mUidStats.get(uid);
2912 public long getProcessWakeTime(int uid, int pid, long realtime) {
2913 uid = mapUid(uid);
2914 Uid u = mUidStats.get(uid);
2916 Uid.Pid p = u.mPids.get(pid);
2924 public void reportExcessiveWakeLocked(int uid, String proc, long overTime, long usedTime) {
2925 uid = mapUid(uid);
2926 Uid u = mUidStats.get(uid);
2932 public void reportExcessiveCpuLocked(int uid, String proc, long overTime, long usedTime) {
2933 uid = mapUid(uid);
2934 Uid u = mUidStats.get(uid);
2942 public void noteStartSensorLocked(int uid, int sensor) {
2943 uid = mapUid(uid);
2953 getUidStatsLocked(uid).noteStartSensor(sensor, elapsedRealtime);
2956 public void noteStopSensorLocked(int uid, int sensor) {
2957 uid = mapUid(uid);
2967 getUidStatsLocked(uid).noteStopSensor(sensor, elapsedRealtime);
2972 public void noteStartGpsLocked(int uid) {
2973 uid = mapUid(uid);
2983 getUidStatsLocked(uid).noteStartGps(elapsedRealtime);
2986 public void noteStopGpsLocked(int uid) {
2987 uid = mapUid(uid);
2997 getUidStatsLocked(uid).noteStopGps(elapsedRealtime);
3092 public void noteUserActivityLocked(int uid, int event) {
3094 uid = mapUid(uid);
3095 getUidStatsLocked(uid).noteUserActivityLocked(event);
3424 public void noteAudioOnLocked(int uid) {
3425 uid = mapUid(uid);
3436 getUidStatsLocked(uid).noteAudioTurnedOnLocked(elapsedRealtime);
3439 public void noteAudioOffLocked(int uid) {
3443 uid = mapUid(uid);
3453 getUidStatsLocked(uid).noteAudioTurnedOffLocked(elapsedRealtime);
3456 public void noteVideoOnLocked(int uid) {
3457 uid = mapUid(uid);
3468 getUidStatsLocked(uid).noteVideoTurnedOnLocked(elapsedRealtime);
3471 public void noteVideoOffLocked(int uid) {
3475 uid = mapUid(uid);
3485 getUidStatsLocked(uid).noteVideoTurnedOffLocked(elapsedRealtime);
3499 BatteryStatsImpl.Uid uid = mUidStats.valueAt(i);
3500 uid.noteResetAudioLocked(elapsedRealtime);
3516 BatteryStatsImpl.Uid uid = mUidStats.valueAt(i);
3517 uid.noteResetVideoLocked(elapsedRealtime);
3522 public void noteActivityResumedLocked(int uid) {
3523 uid = mapUid(uid);
3524 getUidStatsLocked(uid).noteActivityResumedLocked(SystemClock.elapsedRealtime());
3527 public void noteActivityPausedLocked(int uid) {
3528 uid = mapUid(uid);
3529 getUidStatsLocked(uid).noteActivityPausedLocked(SystemClock.elapsedRealtime());
3532 public void noteVibratorOnLocked(int uid, long durationMillis) {
3533 uid = mapUid(uid);
3534 getUidStatsLocked(uid).noteVibratorOnLocked(durationMillis);
3537 public void noteVibratorOffLocked(int uid) {
3538 uid = mapUid(uid);
3539 getUidStatsLocked(uid).noteVibratorOffLocked();
3580 int uid = mapUid(ws.get(i));
3581 getUidStatsLocked(uid).noteWifiRunningLocked(elapsedRealtime);
3593 int uid = mapUid(oldWs.get(i));
3594 getUidStatsLocked(uid).noteWifiStoppedLocked(elapsedRealtime);
3598 int uid = mapUid(newWs.get(i));
3599 getUidStatsLocked(uid).noteWifiRunningLocked(elapsedRealtime);
3618 int uid = mapUid(ws.get(i));
3619 getUidStatsLocked(uid).noteWifiStoppedLocked(elapsedRealtime);
3736 public void noteFullWifiLockAcquiredLocked(int uid) {
3737 uid = mapUid(uid);
3747 getUidStatsLocked(uid).noteFullWifiLockAcquiredLocked(elapsedRealtime);
3750 public void noteFullWifiLockReleasedLocked(int uid) {
3751 uid = mapUid(uid);
3761 getUidStatsLocked(uid).noteFullWifiLockReleasedLocked(elapsedRealtime);
3766 public void noteWifiScanStartedLocked(int uid) {
3767 uid = mapUid(uid);
3777 getUidStatsLocked(uid).noteWifiScanStartedLocked(elapsedRealtime);
3780 public void noteWifiScanStoppedLocked(int uid) {
3781 uid = mapUid(uid);
3791 getUidStatsLocked(uid).noteWifiScanStoppedLocked(elapsedRealtime);
3794 public void noteWifiBatchedScanStartedLocked(int uid, int csph) {
3795 uid = mapUid(uid);
3797 getUidStatsLocked(uid).noteWifiBatchedScanStartedLocked(csph, elapsedRealtime);
3800 public void noteWifiBatchedScanStoppedLocked(int uid) {
3801 uid = mapUid(uid);
3803 getUidStatsLocked(uid).noteWifiBatchedScanStoppedLocked(elapsedRealtime);
3808 public void noteWifiMulticastEnabledLocked(int uid) {
3809 uid = mapUid(uid);
3819 getUidStatsLocked(uid).noteWifiMulticastEnabledLocked(elapsedRealtime);
3822 public void noteWifiMulticastDisabledLocked(int uid) {
3823 uid = mapUid(uid);
3833 getUidStatsLocked(uid).noteWifiMulticastDisabledLocked(elapsedRealtime);
4133 @Override public SparseArray<? extends BatteryStats.Uid> getUidStats() {
4138 * The statistics associated with a particular uid.
4140 public final class Uid extends BatteryStats.Uid {
4179 * The statistics we have collected for this uid's wake locks.
4186 * The statistics we have collected for this uid's syncs.
4190 return new StopwatchTimer(Uid.this, SYNC, null, mOnBatteryTimeBase);
4195 * The statistics we have collected for this uid's jobs.
4199 return new StopwatchTimer(Uid.this, JOB, null, mOnBatteryTimeBase);
4204 * The statistics we have collected for this uid's sensor activations.
4209 * The statistics we have collected for this uid's processes.
4214 * The statistics we have collected for this uid's processes.
4219 * The transient wake stats we have collected for this uid's pids.
4223 public Uid(int uid) {
4224 mUid = uid;
4225 mWifiRunningTimer = new StopwatchTimer(Uid.this, WIFI_RUNNING,
4227 mFullWifiLockTimer = new StopwatchTimer(Uid.this, FULL_WIFI_LOCK,
4229 mWifiScanTimer = new StopwatchTimer(Uid.this, WIFI_SCAN,
4232 mWifiMulticastTimer = new StopwatchTimer(Uid.this, WIFI_MULTICAST_ENABLED,
4238 public Map<String, ? extends BatteryStats.Uid.Wakelock> getWakelockStats() {
4253 public SparseArray<? extends BatteryStats.Uid.Sensor> getSensorStats() {
4258 public Map<String, ? extends BatteryStats.Uid.Proc> getProcessStats() {
4263 public Map<String, ? extends BatteryStats.Uid.Pkg> getPackageStats() {
4277 mWifiRunningTimer = new StopwatchTimer(Uid.this, WIFI_RUNNING,
4297 mFullWifiLockTimer = new StopwatchTimer(Uid.this, FULL_WIFI_LOCK,
4317 mWifiScanTimer = new StopwatchTimer(Uid.this, WIFI_SCAN,
4367 mWifiMulticastTimer = new StopwatchTimer(Uid.this, WIFI_MULTICAST_ENABLED,
4384 mAudioTurnedOnTimer = new StopwatchTimer(Uid.this, AUDIO_TURNED_ON,
4408 mVideoTurnedOnTimer = new StopwatchTimer(Uid.this, VIDEO_TURNED_ON,
4433 Uid.this, FOREGROUND_ACTIVITY, null, mOnBatteryTimeBase);
4468 mVibratorOnTimer = new BatchTimer(Uid.this, VIBRATOR_ON, mOnBatteryTimeBase);
4692 * Clear all stats for this uid. Returns true if the uid is completely
4894 Uid.Wakelock wakelock = wakeStats.valueAt(iw);
4920 Uid.Sensor sensor = mSensorStats.valueAt(ise);
4928 Uid.Proc proc = mProcessStats.valueAt(ip);
4933 for (Map.Entry<String, Uid.Pkg> pkgEntry : mPackageStats.entrySet()) {
4935 Uid.Pkg pkg = pkgEntry.getValue();
5029 Uid.Wakelock wakelock = new Wakelock();
5040 new StopwatchTimer(Uid.this, SYNC, null, timeBase, in));
5049 mJobStats.add(jobName, new StopwatchTimer(Uid.this, JOB, null, timeBase, in));
5057 Uid.Sensor sensor = new Sensor(sensorNumber);
5066 Uid.Proc proc = new Proc(processName);
5075 Uid.Pkg pkg = new Pkg();
5082 mWifiRunningTimer = new StopwatchTimer(Uid.this, WIFI_RUNNING,
5089 mFullWifiLockTimer = new StopwatchTimer(Uid.this, FULL_WIFI_LOCK,
5096 mWifiScanTimer = new StopwatchTimer(Uid.this, WIFI_SCAN,
5111 mWifiMulticastTimer = new StopwatchTimer(Uid.this, WIFI_MULTICAST_ENABLED,
5117 mAudioTurnedOnTimer = new StopwatchTimer(Uid.this, AUDIO_TURNED_ON,
5123 mVideoTurnedOnTimer = new StopwatchTimer(Uid.this, VIDEO_TURNED_ON,
5130 Uid.this, FOREGROUND_ACTIVITY, null, mOnBatteryTimeBase, in);
5143 mVibratorOnTimer = new BatchTimer(Uid.this, VIBRATOR_ON, mOnBatteryTimeBase, in);
5176 public final class Wakelock extends BatteryStats.Uid.Wakelock {
5178 * How long (in ms) this uid has been keeping the device partially awake.
5183 * How long (in ms) this uid has been keeping the device fully awake.
5188 * How long (in ms) this uid has had a window keeping the device awake.
5205 return new StopwatchTimer(Uid.this, type, pool, timeBase, in);
5267 t = new StopwatchTimer(Uid.this, WAKE_TYPE_PARTIAL,
5275 t = new StopwatchTimer(Uid.this, WAKE_TYPE_FULL,
5283 t = new StopwatchTimer(Uid.this, WAKE_TYPE_WINDOW,
5294 public final class Sensor extends BatteryStats.Uid.Sensor {
5312 return new StopwatchTimer(Uid.this, 0, pool, timeBase, in);
5345 public final class Proc extends BatteryStats.Uid.Proc implements TimeBaseObs {
5715 public final class Pkg extends BatteryStats.Uid.Pkg implements TimeBaseObs {
5770 Uid.Pkg.Serv serv = new Serv();
5783 for (Map.Entry<String, Uid.Pkg.Serv> servEntry : mServiceStats.entrySet()) {
5785 Uid.Pkg.Serv serv = servEntry.getValue();
5792 public Map<String, ? extends BatteryStats.Uid.Pkg.Serv> getServiceStats() {
5811 public final class Serv extends BatteryStats.Uid.Pkg.Serv implements TimeBaseObs {
6093 // we may need to change the uid if the currrent uid proc state
6098 // we may need to change the uid if the current uid proc state
6104 // uid's state may have changed; compute what the new state should be.
6203 t = new StopwatchTimer(Uid.this, BatteryStats.SENSOR, timers, mOnBatteryTimeBase);
6482 mReadHistoryUids[idx] = tag.uid;
6495 // Each entry is a fixed 12 bytes: 4 for index, 4 for uid, 4 for string size
7078 final Uid u = getUidStatsLocked(mapUid(entry.uid));
7138 Slog.d(TAG, "Wifi uid " + entry.uid + ": delta rx=" + entry.rxBytes
7145 final Uid u = getUidStatsLocked(mapUid(entry.uid));
7442 * Retrieve the statistics object for a particular uid, creating if needed.
7444 public Uid getUidStatsLocked(int uid) {
7445 Uid u = mUidStats.get(uid);
7447 u = new Uid(uid);
7448 mUidStats.put(uid, u);
7454 * Remove the statistics object for a particular uid.
7456 public void removeUidStatsLocked(int uid) {
7457 mUidStats.remove(uid);
7464 public Uid.Proc getProcessStatsLocked(int uid, String name) {
7465 uid = mapUid(uid);
7466 Uid u = getUidStatsLocked(uid);
7474 public Uid.Pkg getPackageStatsLocked(int uid, String pkg) {
7475 uid = mapUid(uid);
7476 Uid u = getUidStatsLocked(uid);
7484 public Uid.Pkg.Serv getServiceStatsLocked(int uid, String pkg, String name) {
7485 uid = mapUid(uid);
7486 Uid u = getUidStatsLocked(uid);
7496 Uid wifiUid = mUidStats.get(Process.WIFI_UID);
7500 Uid.Proc proc = wifiUid.mProcessStats.valueAt(ip);
7503 Uid uid = mUidStats.valueAt(i);
7504 if (uid.mUid != Process.WIFI_UID) {
7505 long uidRunningTime = uid.getWifiRunningTime(uSecTime, which);
7507 Uid.Proc uidProc = uid.getProcessStatsLocked("*wifi*");
7673 int uid = in.readInt();
7676 tag.uid = uid;
7762 out.writeInt(tag.uid);
7902 int uid = in.readInt();
7903 Uid u = new Uid(uid);
7904 mUidStats.put(uid, u);
7918 u.mWifiBatchedScanBinStarted = Uid.NO_BATCHED_SCAN_STARTED;
7919 for (int i = 0; i < Uid.NUM_WIFI_BATCHED_SCAN_BINS; i++) {
7938 u.mProcessState = Uid.PROCESS_STATE_NONE;
7939 for (int i = 0; i < Uid.NUM_PROCESS_STATE; i++) {
7953 for (int i=0; i<Uid.NUM_USER_ACTIVITY_TYPES; i++) {
8020 Uid.Proc p = u.getProcessStatsLocked(procName);
8049 Uid.Pkg p = u.getPackageStatsLocked(pkgName);
8058 Uid.Pkg.Serv s = u.getServiceStatsLocked(pkgName, servName);
8177 Uid u = mUidStats.valueAt(iu);
8197 for (int i = 0; i < Uid.NUM_WIFI_BATCHED_SCAN_BINS; i++) {
8229 for (int i = 0; i < Uid.NUM_PROCESS_STATE; i++) {
8248 for (int i=0; i<Uid.NUM_USER_ACTIVITY_TYPES; i++) {
8265 final ArrayMap<String, Uid.Wakelock> wakeStats = u.mWakelockStats.getMap();
8270 Uid.Wakelock wl = wakeStats.valueAt(iw);
8311 Uid.Sensor se = u.mSensorStats.valueAt(ise);
8324 Uid.Proc ps = u.mProcessStats.valueAt(ip);
8345 for (Map.Entry<String, BatteryStatsImpl.Uid.Pkg> ent
8348 Uid.Pkg ps = ent.getValue();
8353 for (Map.Entry<String, BatteryStatsImpl.Uid.Pkg.Serv> sent
8356 BatteryStatsImpl.Uid.Pkg.Serv ss = sent.getValue();
8508 int uid = in.readInt();
8509 Uid u = new Uid(uid);
8511 mUidStats.append(uid, u);
8644 Uid uid = mUidStats.valueAt(i);
8646 uid.writeToParcelLocked(out, uSecRealtime);