Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f5c69a7 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "More procstats work."

parents 5bb3b739 a4cc205e
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -1803,8 +1803,8 @@ public abstract class BatteryStats implements Parcelable {
            for (int i=0; i<timers.size(); i++) {
            for (int i=0; i<timers.size(); i++) {
                TimerEntry timer = timers.get(i);
                TimerEntry timer = timers.get(i);
                sb.setLength(0);
                sb.setLength(0);
                sb.append("  Wake lock #");
                sb.append("  Wake lock ");
                sb.append(timer.mId);
                UserHandle.formatUid(sb, timer.mId);
                sb.append(" ");
                sb.append(" ");
                sb.append(timer.mName);
                sb.append(timer.mName);
                printWakeLock(sb, timer.mTimer, batteryRealtime, null, which, ": ");
                printWakeLock(sb, timer.mTimer, batteryRealtime, null, which, ": ");
@@ -1823,7 +1823,10 @@ public abstract class BatteryStats implements Parcelable {
            
            
            Uid u = uidStats.valueAt(iu);
            Uid u = uidStats.valueAt(iu);


            pw.println(prefix + "  #" + uid + ":");
            pw.print(prefix);
            pw.print("  ");
            UserHandle.formatUid(pw, uid);
            pw.println(":");
            boolean uidActivity = false;
            boolean uidActivity = false;
            
            
            long mobileRxBytes = u.getNetworkActivityCount(NETWORK_MOBILE_RX_BYTES, which);
            long mobileRxBytes = u.getNetworkActivityCount(NETWORK_MOBILE_RX_BYTES, which);
+8 −2
Original line number Original line Diff line number Diff line
@@ -168,8 +168,11 @@ public final class UserHandle implements Parcelable {
            if (appId >= Process.FIRST_ISOLATED_UID && appId <= Process.LAST_ISOLATED_UID) {
            if (appId >= Process.FIRST_ISOLATED_UID && appId <= Process.LAST_ISOLATED_UID) {
                sb.append('i');
                sb.append('i');
                sb.append(appId - Process.FIRST_ISOLATED_UID);
                sb.append(appId - Process.FIRST_ISOLATED_UID);
            } else {
            } else if (appId >= Process.FIRST_APPLICATION_UID) {
                sb.append('a');
                sb.append('a');
                sb.append(appId - Process.FIRST_APPLICATION_UID);
            } else {
                sb.append('s');
                sb.append(appId);
                sb.append(appId);
            }
            }
        }
        }
@@ -190,8 +193,11 @@ public final class UserHandle implements Parcelable {
            if (appId >= Process.FIRST_ISOLATED_UID && appId <= Process.LAST_ISOLATED_UID) {
            if (appId >= Process.FIRST_ISOLATED_UID && appId <= Process.LAST_ISOLATED_UID) {
                pw.print('i');
                pw.print('i');
                pw.print(appId - Process.FIRST_ISOLATED_UID);
                pw.print(appId - Process.FIRST_ISOLATED_UID);
            } else {
            } else if (appId >= Process.FIRST_APPLICATION_UID) {
                pw.print('a');
                pw.print('a');
                pw.print(appId - Process.FIRST_APPLICATION_UID);
            } else {
                pw.print('s');
                pw.print(appId);
                pw.print(appId);
            }
            }
        }
        }
+2 −8
Original line number Original line Diff line number Diff line
@@ -1795,7 +1795,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                return;
                return;
            }
            }
            mActivityManagerService.dumpProcessTracker(fd, pw, args);
            mActivityManagerService.mProcessTracker.dump(fd, pw, args);
        }
        }
    }
    }
@@ -1821,7 +1821,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                : mBatteryStatsService.getActiveStatistics().getIsOnBattery();
                : mBatteryStatsService.getActiveStatistics().getIsOnBattery();
        mBatteryStatsService.getActiveStatistics().setCallback(this);
        mBatteryStatsService.getActiveStatistics().setCallback(this);
        mProcessTracker = new ProcessTracker(new File(systemDir, "procstats"));
        mProcessTracker = new ProcessTracker(this, new File(systemDir, "procstats"));
        mUsageStatsService = new UsageStatsService(new File(systemDir, "usagestats").toString());
        mUsageStatsService = new UsageStatsService(new File(systemDir, "usagestats").toString());
        mAppOpsService = new AppOpsService(new File(systemDir, "appops.xml"));
        mAppOpsService = new AppOpsService(new File(systemDir, "appops.xml"));
@@ -11345,12 +11345,6 @@ public final class ActivityManagerService extends ActivityManagerNative
        return false;
        return false;
    }
    }
    final void dumpProcessTracker(FileDescriptor fd, PrintWriter pw, String[] args) {
        synchronized (this) {
            mProcessTracker.dumpLocked(fd, pw, args);
        }
    }
    private final boolean removeDyingProviderLocked(ProcessRecord proc,
    private final boolean removeDyingProviderLocked(ProcessRecord proc,
            ContentProviderRecord cpr, boolean always) {
            ContentProviderRecord cpr, boolean always) {
        final boolean inLaunching = mLaunchingProviders.contains(cpr);
        final boolean inLaunching = mLaunchingProviders.contains(cpr);
+8 −2
Original line number Original line Diff line number Diff line
@@ -425,8 +425,14 @@ final class ProcessRecord {
        } else {
        } else {
            sb.append('u');
            sb.append('u');
            sb.append(userId);
            sb.append(userId);
            int appId = UserHandle.getAppId(info.uid);
            if (appId >= Process.FIRST_APPLICATION_UID) {
                sb.append('a');
                sb.append('a');
            sb.append(UserHandle.getAppId(info.uid));
                sb.append(appId - Process.FIRST_APPLICATION_UID);
            } else {
                sb.append('s');
                sb.append(appId);
            }
            if (uid != info.uid) {
            if (uid != info.uid) {
                sb.append('i');
                sb.append('i');
                sb.append(UserHandle.getAppId(uid) - Process.FIRST_ISOLATED_UID);
                sb.append(UserHandle.getAppId(uid) - Process.FIRST_ISOLATED_UID);