Loading services/java/com/android/server/am/ActivityManagerService.java +12 −1 Original line number Diff line number Diff line Loading @@ -415,6 +415,11 @@ public final class ActivityManagerService extends ActivityManagerNative */ ProcessRecord mPreviousProcess; /** * The time at which the previous process was last visible. */ long mPreviousProcessVisibleTime; /** * Packages that the user has asked to have run in screen size * compatibility mode instead of filling the screen. Loading Loading @@ -8361,6 +8366,12 @@ public final class ActivityManagerService extends ActivityManagerNative pw.println(); pw.println(" mHomeProcess: " + mHomeProcess); pw.println(" mPreviousProcess: " + mPreviousProcess); if (dumpAll) { StringBuilder sb = new StringBuilder(128); sb.append(" mPreviousProcessVisibleTime: "); TimeUtils.formatDuration(mPreviousProcessVisibleTime, sb); pw.println(sb); } if (mHeavyWeightProcess != null) { pw.println(" mHeavyWeightProcess: " + mHeavyWeightProcess); } Loading services/java/com/android/server/am/ActivityRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ final class ActivityRecord { ThumbnailHolder thumbHolder; // where our thumbnails should go. long launchTime; // when we starting launching this activity long startTime; // last time this activity was started long lastVisibleTime; // last time this activity became visible long cpuTimeAtResume; // the cpu time of host process at the time of resuming activity Configuration configuration; // configuration activity was last running in CompatibilityInfo compat;// last used compatibility mode Loading Loading @@ -188,6 +189,10 @@ final class ActivityRecord { TimeUtils.formatDuration(launchTime, pw); pw.print(" startTime="); TimeUtils.formatDuration(startTime, pw); pw.println(""); } if (lastVisibleTime != 0) { pw.print(prefix); pw.print("lastVisibleTime="); TimeUtils.formatDuration(lastVisibleTime, pw); pw.println(""); } if (waitingVisible || nowVisible) { pw.print(prefix); pw.print("waitingVisible="); pw.print(waitingVisible); pw.print(" nowVisible="); pw.println(nowVisible); Loading Loading @@ -632,6 +637,7 @@ final class ActivityRecord { ActivityManagerService.TAG, "windowsVisible(): " + this); if (!nowVisible) { nowVisible = true; lastVisibleTime = SystemClock.uptimeMillis(); if (!idle) { // Instead of doing the full stop routine here, let's just // hide any activities we now can, and let them stop when Loading services/java/com/android/server/am/ActivityStack.java +16 −8 Original line number Diff line number Diff line Loading @@ -949,6 +949,22 @@ final class ActivityStack { if (r.configDestroy) { destroyActivityLocked(r, true, false, "stop-config"); resumeTopActivityLocked(null); } else { // Now that this process has stopped, we may want to consider // it to be the previous app to try to keep around in case // the user wants to return to it. ProcessRecord fgApp = null; if (mResumedActivity != null) { fgApp = mResumedActivity.app; } else if (mPausingActivity != null) { fgApp = mPausingActivity.app; } if (r.app != null && fgApp != null && r.app != fgApp && r.lastVisibleTime > mService.mPreviousProcessVisibleTime && r.app != mService.mHomeProcess) { mService.mPreviousProcess = r.app; mService.mPreviousProcessVisibleTime = r.lastVisibleTime; } } } } Loading Loading @@ -1363,14 +1379,6 @@ final class ActivityStack { + ", nowVisible=" + next.nowVisible); } } if (!prev.finishing && prev.app != null && prev.app != next.app && prev.app != mService.mHomeProcess) { // We are switching to a new activity that is in a different // process than the previous one. Note the previous process, // so we can try to keep it around. mService.mPreviousProcess = prev.app; } } // Launching this app's activity, make sure the app is no longer Loading Loading
services/java/com/android/server/am/ActivityManagerService.java +12 −1 Original line number Diff line number Diff line Loading @@ -415,6 +415,11 @@ public final class ActivityManagerService extends ActivityManagerNative */ ProcessRecord mPreviousProcess; /** * The time at which the previous process was last visible. */ long mPreviousProcessVisibleTime; /** * Packages that the user has asked to have run in screen size * compatibility mode instead of filling the screen. Loading Loading @@ -8361,6 +8366,12 @@ public final class ActivityManagerService extends ActivityManagerNative pw.println(); pw.println(" mHomeProcess: " + mHomeProcess); pw.println(" mPreviousProcess: " + mPreviousProcess); if (dumpAll) { StringBuilder sb = new StringBuilder(128); sb.append(" mPreviousProcessVisibleTime: "); TimeUtils.formatDuration(mPreviousProcessVisibleTime, sb); pw.println(sb); } if (mHeavyWeightProcess != null) { pw.println(" mHeavyWeightProcess: " + mHeavyWeightProcess); } Loading
services/java/com/android/server/am/ActivityRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ final class ActivityRecord { ThumbnailHolder thumbHolder; // where our thumbnails should go. long launchTime; // when we starting launching this activity long startTime; // last time this activity was started long lastVisibleTime; // last time this activity became visible long cpuTimeAtResume; // the cpu time of host process at the time of resuming activity Configuration configuration; // configuration activity was last running in CompatibilityInfo compat;// last used compatibility mode Loading Loading @@ -188,6 +189,10 @@ final class ActivityRecord { TimeUtils.formatDuration(launchTime, pw); pw.print(" startTime="); TimeUtils.formatDuration(startTime, pw); pw.println(""); } if (lastVisibleTime != 0) { pw.print(prefix); pw.print("lastVisibleTime="); TimeUtils.formatDuration(lastVisibleTime, pw); pw.println(""); } if (waitingVisible || nowVisible) { pw.print(prefix); pw.print("waitingVisible="); pw.print(waitingVisible); pw.print(" nowVisible="); pw.println(nowVisible); Loading Loading @@ -632,6 +637,7 @@ final class ActivityRecord { ActivityManagerService.TAG, "windowsVisible(): " + this); if (!nowVisible) { nowVisible = true; lastVisibleTime = SystemClock.uptimeMillis(); if (!idle) { // Instead of doing the full stop routine here, let's just // hide any activities we now can, and let them stop when Loading
services/java/com/android/server/am/ActivityStack.java +16 −8 Original line number Diff line number Diff line Loading @@ -949,6 +949,22 @@ final class ActivityStack { if (r.configDestroy) { destroyActivityLocked(r, true, false, "stop-config"); resumeTopActivityLocked(null); } else { // Now that this process has stopped, we may want to consider // it to be the previous app to try to keep around in case // the user wants to return to it. ProcessRecord fgApp = null; if (mResumedActivity != null) { fgApp = mResumedActivity.app; } else if (mPausingActivity != null) { fgApp = mPausingActivity.app; } if (r.app != null && fgApp != null && r.app != fgApp && r.lastVisibleTime > mService.mPreviousProcessVisibleTime && r.app != mService.mHomeProcess) { mService.mPreviousProcess = r.app; mService.mPreviousProcessVisibleTime = r.lastVisibleTime; } } } } Loading Loading @@ -1363,14 +1379,6 @@ final class ActivityStack { + ", nowVisible=" + next.nowVisible); } } if (!prev.finishing && prev.app != null && prev.app != next.app && prev.app != mService.mHomeProcess) { // We are switching to a new activity that is in a different // process than the previous one. Note the previous process, // so we can try to keep it around. mService.mPreviousProcess = prev.app; } } // Launching this app's activity, make sure the app is no longer Loading