Loading services/core/java/com/android/server/am/ActivityManagerService.java +15 −9 Original line number Diff line number Diff line Loading @@ -18696,7 +18696,7 @@ public final class ActivityManagerService extends ActivityManagerNative synchronized(this) { final long origId = Binder.clearCallingIdentity(); updateConfigurationLocked(values, null, false, true, userId); updateConfigurationLocked(values, null, false, true, userId, false /* deferResume */); Binder.restoreCallingIdentity(origId); } } Loading Loading @@ -18764,11 +18764,16 @@ public final class ActivityManagerService extends ActivityManagerNative updateConfigurationLocked(configuration, null, false); } boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale) { boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale) { return updateConfigurationLocked(values, starting, initLocale, false /* deferResume */); } boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale, boolean deferResume) { // pass UserHandle.USER_NULL as userId because we don't persist configuration for any user return updateConfigurationLocked(values, starting, initLocale, false, UserHandle.USER_NULL); return updateConfigurationLocked(values, starting, initLocale, false /* persistent */, UserHandle.USER_NULL, deferResume); } // To cache the list of supported system locales Loading @@ -18784,8 +18789,8 @@ public final class ActivityManagerService extends ActivityManagerNative * @param userId is only used when persistent parameter is set to true to persist configuration * for that particular user */ private boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale, boolean persistent, int userId) { private boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale, boolean persistent, int userId, boolean deferResume) { int changes = 0; if (mWindowManager != null) { Loading Loading @@ -18913,7 +18918,7 @@ public final class ActivityManagerService extends ActivityManagerNative for (int stackId : resizedStacks) { final Rect newBounds = mWindowManager.getBoundsForNewConfiguration(stackId); mStackSupervisor.resizeStackLocked( stackId, newBounds, null, null, false, false, !DEFER_RESUME); stackId, newBounds, null, null, false, false, deferResume); } } } Loading Loading @@ -21810,7 +21815,8 @@ public final class ActivityManagerService extends ActivityManagerNative Preconditions.checkNotNull(values, "Configuration must not be null"); Preconditions.checkArgumentNonnegative(userId, "userId " + userId + " not supported"); synchronized (ActivityManagerService.this) { updateConfigurationLocked(values, null, false, true, userId); updateConfigurationLocked(values, null, false, true, userId, false /* deferResume */); } } services/core/java/com/android/server/am/ActivityStackSupervisor.java +19 −6 Original line number Diff line number Diff line Loading @@ -1189,7 +1189,10 @@ public final class ActivityStackSupervisor implements DisplayListener { Configuration config = mWindowManager.updateOrientationFromAppTokens( mService.mConfiguration, r.mayFreezeScreenLocked(app) ? r.appToken : null); mService.updateConfigurationLocked(config, r, false); // Deferring resume here because we're going to launch new activity shortly. // We don't want to perform a redundant launch of the same record while ensuring // configurations and trying to resume top activity of focused stack. mService.updateConfigurationLocked(config, r, false, true /* deferResume */); } r.app = app; Loading Loading @@ -2004,7 +2007,7 @@ public final class ActivityStackSupervisor implements DisplayListener { boolean preserveWindows, boolean allowResizeInDockedMode, boolean deferResume) { if (stackId == DOCKED_STACK_ID) { resizeDockedStackLocked(bounds, tempTaskBounds, tempTaskInsetBounds, null, null, preserveWindows); preserveWindows, deferResume); return; } final ActivityStack stack = getStack(stackId); Loading Loading @@ -2154,8 +2157,16 @@ public final class ActivityStackSupervisor implements DisplayListener { } void resizeDockedStackLocked(Rect dockedBounds, Rect tempDockedTaskBounds, Rect tempDockedTaskInsetBounds, Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds, boolean preserveWindows) { Rect tempDockedTaskInsetBounds, Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds, boolean preserveWindows) { resizeDockedStackLocked(dockedBounds, tempDockedTaskBounds, tempDockedTaskInsetBounds, tempOtherTaskBounds, tempOtherTaskInsetBounds, preserveWindows, false /* deferResume */); } void resizeDockedStackLocked(Rect dockedBounds, Rect tempDockedTaskBounds, Rect tempDockedTaskInsetBounds, Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds, boolean preserveWindows, boolean deferResume) { if (!mAllowDockedStackResize) { // Docked stack resize currently disabled. Loading Loading @@ -2198,11 +2209,13 @@ public final class ActivityStackSupervisor implements DisplayListener { if (StackId.isResizeableByDockedStack(i) && getStack(i) != null) { resizeStackLocked(i, tempRect, tempOtherTaskBounds, tempOtherTaskInsetBounds, preserveWindows, true /* allowResizeInDockedMode */, !DEFER_RESUME); true /* allowResizeInDockedMode */, deferResume); } } } if (!deferResume) { stack.ensureVisibleActivitiesConfigurationLocked(r, preserveWindows); } } finally { mAllowDockedStackResize = true; mWindowManager.continueSurfaceLayout(); Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +15 −9 Original line number Diff line number Diff line Loading @@ -18696,7 +18696,7 @@ public final class ActivityManagerService extends ActivityManagerNative synchronized(this) { final long origId = Binder.clearCallingIdentity(); updateConfigurationLocked(values, null, false, true, userId); updateConfigurationLocked(values, null, false, true, userId, false /* deferResume */); Binder.restoreCallingIdentity(origId); } } Loading Loading @@ -18764,11 +18764,16 @@ public final class ActivityManagerService extends ActivityManagerNative updateConfigurationLocked(configuration, null, false); } boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale) { boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale) { return updateConfigurationLocked(values, starting, initLocale, false /* deferResume */); } boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale, boolean deferResume) { // pass UserHandle.USER_NULL as userId because we don't persist configuration for any user return updateConfigurationLocked(values, starting, initLocale, false, UserHandle.USER_NULL); return updateConfigurationLocked(values, starting, initLocale, false /* persistent */, UserHandle.USER_NULL, deferResume); } // To cache the list of supported system locales Loading @@ -18784,8 +18789,8 @@ public final class ActivityManagerService extends ActivityManagerNative * @param userId is only used when persistent parameter is set to true to persist configuration * for that particular user */ private boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale, boolean persistent, int userId) { private boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale, boolean persistent, int userId, boolean deferResume) { int changes = 0; if (mWindowManager != null) { Loading Loading @@ -18913,7 +18918,7 @@ public final class ActivityManagerService extends ActivityManagerNative for (int stackId : resizedStacks) { final Rect newBounds = mWindowManager.getBoundsForNewConfiguration(stackId); mStackSupervisor.resizeStackLocked( stackId, newBounds, null, null, false, false, !DEFER_RESUME); stackId, newBounds, null, null, false, false, deferResume); } } } Loading Loading @@ -21810,7 +21815,8 @@ public final class ActivityManagerService extends ActivityManagerNative Preconditions.checkNotNull(values, "Configuration must not be null"); Preconditions.checkArgumentNonnegative(userId, "userId " + userId + " not supported"); synchronized (ActivityManagerService.this) { updateConfigurationLocked(values, null, false, true, userId); updateConfigurationLocked(values, null, false, true, userId, false /* deferResume */); } }
services/core/java/com/android/server/am/ActivityStackSupervisor.java +19 −6 Original line number Diff line number Diff line Loading @@ -1189,7 +1189,10 @@ public final class ActivityStackSupervisor implements DisplayListener { Configuration config = mWindowManager.updateOrientationFromAppTokens( mService.mConfiguration, r.mayFreezeScreenLocked(app) ? r.appToken : null); mService.updateConfigurationLocked(config, r, false); // Deferring resume here because we're going to launch new activity shortly. // We don't want to perform a redundant launch of the same record while ensuring // configurations and trying to resume top activity of focused stack. mService.updateConfigurationLocked(config, r, false, true /* deferResume */); } r.app = app; Loading Loading @@ -2004,7 +2007,7 @@ public final class ActivityStackSupervisor implements DisplayListener { boolean preserveWindows, boolean allowResizeInDockedMode, boolean deferResume) { if (stackId == DOCKED_STACK_ID) { resizeDockedStackLocked(bounds, tempTaskBounds, tempTaskInsetBounds, null, null, preserveWindows); preserveWindows, deferResume); return; } final ActivityStack stack = getStack(stackId); Loading Loading @@ -2154,8 +2157,16 @@ public final class ActivityStackSupervisor implements DisplayListener { } void resizeDockedStackLocked(Rect dockedBounds, Rect tempDockedTaskBounds, Rect tempDockedTaskInsetBounds, Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds, boolean preserveWindows) { Rect tempDockedTaskInsetBounds, Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds, boolean preserveWindows) { resizeDockedStackLocked(dockedBounds, tempDockedTaskBounds, tempDockedTaskInsetBounds, tempOtherTaskBounds, tempOtherTaskInsetBounds, preserveWindows, false /* deferResume */); } void resizeDockedStackLocked(Rect dockedBounds, Rect tempDockedTaskBounds, Rect tempDockedTaskInsetBounds, Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds, boolean preserveWindows, boolean deferResume) { if (!mAllowDockedStackResize) { // Docked stack resize currently disabled. Loading Loading @@ -2198,11 +2209,13 @@ public final class ActivityStackSupervisor implements DisplayListener { if (StackId.isResizeableByDockedStack(i) && getStack(i) != null) { resizeStackLocked(i, tempRect, tempOtherTaskBounds, tempOtherTaskInsetBounds, preserveWindows, true /* allowResizeInDockedMode */, !DEFER_RESUME); true /* allowResizeInDockedMode */, deferResume); } } } if (!deferResume) { stack.ensureVisibleActivitiesConfigurationLocked(r, preserveWindows); } } finally { mAllowDockedStackResize = true; mWindowManager.continueSurfaceLayout(); Loading