Loading core/java/android/app/IActivityManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -662,9 +662,11 @@ public interface IActivityManager extends IInterface { public void setRenderThread(int tid) throws RemoteException; /** * Let's activity manager know whether the calling process is currently showing "top-level" UI * Lets activity manager know whether the calling process is currently showing "top-level" UI * that is not an activity, i.e. windows on the screen the user is currently interacting with. * * <p>This flag can only be set for persistent processes. * * @param hasTopUi Whether the calling process has "top-level" UI. */ public void setHasTopUi(boolean hasTopUi) throws RemoteException; Loading services/core/java/com/android/server/am/ActivityManagerService.java +7 −2 Original line number Diff line number Diff line Loading @@ -12709,6 +12709,7 @@ public final class ActivityManagerService extends ActivityManagerNative return; } if (pr.hasTopUi != hasTopUi) { Slog.i(TAG, "Setting hasTopUi=" + hasTopUi + " for pid=" + pid); pr.hasTopUi = hasTopUi; changed = true; } Loading Loading @@ -19203,10 +19204,14 @@ public final class ActivityManagerService extends ActivityManagerNative // facilitate this, here we need to determine whether or not it // is currently showing UI. app.systemNoUi = true; if (app == TOP_APP || app.hasTopUi) { if (app == TOP_APP) { app.systemNoUi = false; app.curSchedGroup = ProcessList.SCHED_GROUP_TOP_APP; app.adjType = "pers-top-activity"; } else if (app.hasTopUi) { app.systemNoUi = false; app.curSchedGroup = ProcessList.SCHED_GROUP_TOP_APP; app.adjType = "pers-top-ui"; } else if (activitiesSize > 0) { for (int j = 0; j < activitiesSize; j++) { final ActivityRecord r = app.activities.get(j); Loading @@ -19232,7 +19237,7 @@ public final class ActivityManagerService extends ActivityManagerNative int procState; boolean foregroundActivities = false; BroadcastQueue queue; if (app == TOP_APP || app.hasTopUi) { if (app == TOP_APP) { // The last app on the list is the foreground app. adj = ProcessList.FOREGROUND_APP_ADJ; schedGroup = ProcessList.SCHED_GROUP_TOP_APP; services/core/java/com/android/server/am/ProcessRecord.java +3 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,9 @@ final class ProcessRecord { pw.print(prefix); pw.print(" - "); pw.println(receivers.valueAt(i)); } } if (hasTopUi) { pw.print(prefix); pw.print("hasTopUi="); pw.print(hasTopUi); } } ProcessRecord(BatteryStatsImpl _batteryStats, ApplicationInfo _info, Loading Loading
core/java/android/app/IActivityManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -662,9 +662,11 @@ public interface IActivityManager extends IInterface { public void setRenderThread(int tid) throws RemoteException; /** * Let's activity manager know whether the calling process is currently showing "top-level" UI * Lets activity manager know whether the calling process is currently showing "top-level" UI * that is not an activity, i.e. windows on the screen the user is currently interacting with. * * <p>This flag can only be set for persistent processes. * * @param hasTopUi Whether the calling process has "top-level" UI. */ public void setHasTopUi(boolean hasTopUi) throws RemoteException; Loading
services/core/java/com/android/server/am/ActivityManagerService.java +7 −2 Original line number Diff line number Diff line Loading @@ -12709,6 +12709,7 @@ public final class ActivityManagerService extends ActivityManagerNative return; } if (pr.hasTopUi != hasTopUi) { Slog.i(TAG, "Setting hasTopUi=" + hasTopUi + " for pid=" + pid); pr.hasTopUi = hasTopUi; changed = true; } Loading Loading @@ -19203,10 +19204,14 @@ public final class ActivityManagerService extends ActivityManagerNative // facilitate this, here we need to determine whether or not it // is currently showing UI. app.systemNoUi = true; if (app == TOP_APP || app.hasTopUi) { if (app == TOP_APP) { app.systemNoUi = false; app.curSchedGroup = ProcessList.SCHED_GROUP_TOP_APP; app.adjType = "pers-top-activity"; } else if (app.hasTopUi) { app.systemNoUi = false; app.curSchedGroup = ProcessList.SCHED_GROUP_TOP_APP; app.adjType = "pers-top-ui"; } else if (activitiesSize > 0) { for (int j = 0; j < activitiesSize; j++) { final ActivityRecord r = app.activities.get(j); Loading @@ -19232,7 +19237,7 @@ public final class ActivityManagerService extends ActivityManagerNative int procState; boolean foregroundActivities = false; BroadcastQueue queue; if (app == TOP_APP || app.hasTopUi) { if (app == TOP_APP) { // The last app on the list is the foreground app. adj = ProcessList.FOREGROUND_APP_ADJ; schedGroup = ProcessList.SCHED_GROUP_TOP_APP;
services/core/java/com/android/server/am/ProcessRecord.java +3 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,9 @@ final class ProcessRecord { pw.print(prefix); pw.print(" - "); pw.println(receivers.valueAt(i)); } } if (hasTopUi) { pw.print(prefix); pw.print("hasTopUi="); pw.print(hasTopUi); } } ProcessRecord(BatteryStatsImpl _batteryStats, ApplicationInfo _info, Loading