OSDN Git Service

Merge "Unblock 'am start -W' if activity is brought to front without launching" into...
[android-x86/frameworks-base.git] / services / core / java / com / android / server / am / ActivityStackSupervisor.java
index 033471c..36207c4 100644 (file)
@@ -3045,8 +3045,9 @@ public final class ActivityStackSupervisor implements DisplayListener {
 
     /** Checks whether the activity should be shown for current user. */
     boolean okToShowLocked(ActivityRecord r) {
-        return r != null && (isCurrentProfileLocked(r.userId)
-                || (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0);
+        return r != null && ((r.info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0
+                || (isCurrentProfileLocked(r.userId)
+                && !mService.mUserController.isUserStoppingOrShuttingDownLocked(r.userId)));
     }
 
     final ArrayList<ActivityRecord> processStoppingActivitiesLocked(boolean remove) {