Loading services/core/java/com/android/server/wm/ActivityStarter.java +4 −0 Original line number Diff line number Diff line Loading @@ -997,6 +997,10 @@ class ActivityStarter { if (callerApp.areBackgroundActivityStartsAllowed()) { return false; } // don't abort if the caller has an activity in any foreground task if (callerApp.hasActivityInVisibleTask()) { return false; } } // don't abort if the callingUid has START_ACTIVITIES_FROM_BACKGROUND permission if (mService.checkPermission(START_ACTIVITIES_FROM_BACKGROUND, callingPid, callingUid) Loading services/core/java/com/android/server/wm/WindowProcessController.java +14 −0 Original line number Diff line number Diff line Loading @@ -471,6 +471,20 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio } } boolean hasActivityInVisibleTask() { for (int i = mActivities.size() - 1; i >= 0; --i) { TaskRecord task = mActivities.get(i).getTaskRecord(); if (task == null) { continue; } ActivityRecord topActivity = task.getTopActivity(); if (topActivity != null && topActivity.visible) { return true; } } return false; } /** * Update the top resuming activity in process for pre-Q apps, only the top-most visible * activities are allowed to be resumed per process. Loading Loading
services/core/java/com/android/server/wm/ActivityStarter.java +4 −0 Original line number Diff line number Diff line Loading @@ -997,6 +997,10 @@ class ActivityStarter { if (callerApp.areBackgroundActivityStartsAllowed()) { return false; } // don't abort if the caller has an activity in any foreground task if (callerApp.hasActivityInVisibleTask()) { return false; } } // don't abort if the callingUid has START_ACTIVITIES_FROM_BACKGROUND permission if (mService.checkPermission(START_ACTIVITIES_FROM_BACKGROUND, callingPid, callingUid) Loading
services/core/java/com/android/server/wm/WindowProcessController.java +14 −0 Original line number Diff line number Diff line Loading @@ -471,6 +471,20 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio } } boolean hasActivityInVisibleTask() { for (int i = mActivities.size() - 1; i >= 0; --i) { TaskRecord task = mActivities.get(i).getTaskRecord(); if (task == null) { continue; } ActivityRecord topActivity = task.getTopActivity(); if (topActivity != null && topActivity.visible) { return true; } } return false; } /** * Update the top resuming activity in process for pre-Q apps, only the top-most visible * activities are allowed to be resumed per process. Loading