Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +8 −17 Original line number Diff line number Diff line Loading @@ -4015,8 +4015,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { deferWindowLayout(); try { if (values != null) { changes = updateGlobalConfigurationLocked(values, initLocale, persistent, userId, deferResume); changes = updateGlobalConfigurationLocked(values, initLocale, persistent, userId); } if (!deferResume) { Loading @@ -4035,7 +4034,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { /** Update default (global) configuration and notify listeners about changes. */ int updateGlobalConfigurationLocked(@NonNull Configuration values, boolean initLocale, boolean persistent, int userId, boolean deferResume) { boolean persistent, int userId) { final DisplayContent defaultDisplay = mRootWindowContainer.getDisplayContent(DEFAULT_DISPLAY); Loading @@ -4047,7 +4046,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { // setting WindowManagerService.mWaitingForConfig to true, it is important that we call // performDisplayOverrideConfigUpdate in order to send the new display configuration // (even if there are no actual changes) to unfreeze the window. defaultDisplay.performDisplayOverrideConfigUpdate(values, deferResume); defaultDisplay.performDisplayOverrideConfigUpdate(values); return 0; } Loading Loading @@ -4095,9 +4094,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mTempConfig.seq = increaseConfigurationSeqLocked(); // Update stored global config and notify everyone about the change. mRootWindowContainer.onConfigurationChanged(mTempConfig); Slog.i(TAG, "Config changes=" + Integer.toHexString(changes) + " " + mTempConfig); // TODO(multi-display): Update UsageEvents#Event to include displayId. mUsageStatsInternal.reportConfigurationChange(mTempConfig, mAmInternal.getCurrentUserId()); Loading @@ -4116,13 +4112,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { // resources have that config before following boot code is executed. mSystemThread.applyConfigurationToResources(mTempConfig); // We need another copy of global config because we're scheduling some calls instead of // running them in place. We need to be sure that object we send will be handled unchanged. final Configuration configCopy = new Configuration(mTempConfig); if (persistent && Settings.System.hasInterestingConfigurationChanges(changes)) { final Message msg = PooledLambda.obtainMessage( ActivityTaskManagerService::sendPutConfigurationForUserMsg, this, userId, configCopy); this, userId, new Configuration(mTempConfig)); mH.sendMessage(msg); } Loading @@ -4131,8 +4124,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { final int pid = pidMap.keyAt(i); final WindowProcessController app = pidMap.get(pid); ProtoLog.v(WM_DEBUG_CONFIGURATION, "Update process config of %s to new " + "config %s", app.mName, configCopy); app.onConfigurationChanged(configCopy); + "config %s", app.mName, mTempConfig); app.onConfigurationChanged(mTempConfig); } final Message msg = PooledLambda.obtainMessage( Loading @@ -4140,10 +4133,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mAmInternal, changes, initLocale); mH.sendMessage(msg); // Override configuration of the default display duplicates global config, so we need to // update it also. This will also notify WindowManager about changes. defaultDisplay.performDisplayOverrideConfigUpdate(mRootWindowContainer.getConfiguration(), deferResume); // Update stored global config and notify everyone about the change. mRootWindowContainer.onConfigurationChanged(mTempConfig); return changes; } Loading services/core/java/com/android/server/wm/ConfigurationContainer.java +4 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,10 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> { mChangeListeners.get(i).onMergedOverrideConfigurationChanged( mMergedOverrideConfiguration); } dispatchConfigurationToChildren(); } void dispatchConfigurationToChildren() { for (int i = getChildCount() - 1; i >= 0; --i) { final ConfigurationContainer child = getChildAt(i); child.onConfigurationChanged(mFullConfiguration); Loading services/core/java/com/android/server/wm/DisplayContent.java +3 −3 Original line number Diff line number Diff line Loading @@ -5467,9 +5467,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // apply the correct override config. changes = mAtmService.updateGlobalConfigurationLocked(values, false /* initLocale */, false /* persistent */, UserHandle.USER_NULL /* userId */, deferResume); UserHandle.USER_NULL /* userId */); } else { changes = performDisplayOverrideConfigUpdate(values, deferResume); changes = performDisplayOverrideConfigUpdate(values); } } Loading @@ -5487,7 +5487,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return kept; } int performDisplayOverrideConfigUpdate(Configuration values, boolean deferResume) { int performDisplayOverrideConfigUpdate(Configuration values) { mTempConfig.setTo(getRequestedOverrideConfiguration()); final int changes = mTempConfig.updateFrom(values); if (changes != 0) { Loading services/core/java/com/android/server/wm/RootWindowContainer.java +14 −0 Original line number Diff line number Diff line Loading @@ -649,6 +649,20 @@ class RootWindowContainer extends WindowContainer<DisplayContent> onConfigurationChanged(newConfiguration); } @Override void dispatchConfigurationToChildren() { final Configuration configuration = getConfiguration(); for (int i = getChildCount() - 1; i >= 0; i--) { final DisplayContent displayContent = getChildAt(i); if (displayContent.isDefaultDisplay) { // The global configuration is also the override configuration of default display. displayContent.performDisplayOverrideConfigUpdate(configuration); } else { displayContent.onConfigurationChanged(configuration); } } } @Override public void onConfigurationChanged(Configuration newParentConfig) { prepareFreezingTaskBounds(); Loading Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +8 −17 Original line number Diff line number Diff line Loading @@ -4015,8 +4015,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { deferWindowLayout(); try { if (values != null) { changes = updateGlobalConfigurationLocked(values, initLocale, persistent, userId, deferResume); changes = updateGlobalConfigurationLocked(values, initLocale, persistent, userId); } if (!deferResume) { Loading @@ -4035,7 +4034,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { /** Update default (global) configuration and notify listeners about changes. */ int updateGlobalConfigurationLocked(@NonNull Configuration values, boolean initLocale, boolean persistent, int userId, boolean deferResume) { boolean persistent, int userId) { final DisplayContent defaultDisplay = mRootWindowContainer.getDisplayContent(DEFAULT_DISPLAY); Loading @@ -4047,7 +4046,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { // setting WindowManagerService.mWaitingForConfig to true, it is important that we call // performDisplayOverrideConfigUpdate in order to send the new display configuration // (even if there are no actual changes) to unfreeze the window. defaultDisplay.performDisplayOverrideConfigUpdate(values, deferResume); defaultDisplay.performDisplayOverrideConfigUpdate(values); return 0; } Loading Loading @@ -4095,9 +4094,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mTempConfig.seq = increaseConfigurationSeqLocked(); // Update stored global config and notify everyone about the change. mRootWindowContainer.onConfigurationChanged(mTempConfig); Slog.i(TAG, "Config changes=" + Integer.toHexString(changes) + " " + mTempConfig); // TODO(multi-display): Update UsageEvents#Event to include displayId. mUsageStatsInternal.reportConfigurationChange(mTempConfig, mAmInternal.getCurrentUserId()); Loading @@ -4116,13 +4112,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { // resources have that config before following boot code is executed. mSystemThread.applyConfigurationToResources(mTempConfig); // We need another copy of global config because we're scheduling some calls instead of // running them in place. We need to be sure that object we send will be handled unchanged. final Configuration configCopy = new Configuration(mTempConfig); if (persistent && Settings.System.hasInterestingConfigurationChanges(changes)) { final Message msg = PooledLambda.obtainMessage( ActivityTaskManagerService::sendPutConfigurationForUserMsg, this, userId, configCopy); this, userId, new Configuration(mTempConfig)); mH.sendMessage(msg); } Loading @@ -4131,8 +4124,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { final int pid = pidMap.keyAt(i); final WindowProcessController app = pidMap.get(pid); ProtoLog.v(WM_DEBUG_CONFIGURATION, "Update process config of %s to new " + "config %s", app.mName, configCopy); app.onConfigurationChanged(configCopy); + "config %s", app.mName, mTempConfig); app.onConfigurationChanged(mTempConfig); } final Message msg = PooledLambda.obtainMessage( Loading @@ -4140,10 +4133,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mAmInternal, changes, initLocale); mH.sendMessage(msg); // Override configuration of the default display duplicates global config, so we need to // update it also. This will also notify WindowManager about changes. defaultDisplay.performDisplayOverrideConfigUpdate(mRootWindowContainer.getConfiguration(), deferResume); // Update stored global config and notify everyone about the change. mRootWindowContainer.onConfigurationChanged(mTempConfig); return changes; } Loading
services/core/java/com/android/server/wm/ConfigurationContainer.java +4 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,10 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> { mChangeListeners.get(i).onMergedOverrideConfigurationChanged( mMergedOverrideConfiguration); } dispatchConfigurationToChildren(); } void dispatchConfigurationToChildren() { for (int i = getChildCount() - 1; i >= 0; --i) { final ConfigurationContainer child = getChildAt(i); child.onConfigurationChanged(mFullConfiguration); Loading
services/core/java/com/android/server/wm/DisplayContent.java +3 −3 Original line number Diff line number Diff line Loading @@ -5467,9 +5467,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // apply the correct override config. changes = mAtmService.updateGlobalConfigurationLocked(values, false /* initLocale */, false /* persistent */, UserHandle.USER_NULL /* userId */, deferResume); UserHandle.USER_NULL /* userId */); } else { changes = performDisplayOverrideConfigUpdate(values, deferResume); changes = performDisplayOverrideConfigUpdate(values); } } Loading @@ -5487,7 +5487,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return kept; } int performDisplayOverrideConfigUpdate(Configuration values, boolean deferResume) { int performDisplayOverrideConfigUpdate(Configuration values) { mTempConfig.setTo(getRequestedOverrideConfiguration()); final int changes = mTempConfig.updateFrom(values); if (changes != 0) { Loading
services/core/java/com/android/server/wm/RootWindowContainer.java +14 −0 Original line number Diff line number Diff line Loading @@ -649,6 +649,20 @@ class RootWindowContainer extends WindowContainer<DisplayContent> onConfigurationChanged(newConfiguration); } @Override void dispatchConfigurationToChildren() { final Configuration configuration = getConfiguration(); for (int i = getChildCount() - 1; i >= 0; i--) { final DisplayContent displayContent = getChildAt(i); if (displayContent.isDefaultDisplay) { // The global configuration is also the override configuration of default display. displayContent.performDisplayOverrideConfigUpdate(configuration); } else { displayContent.onConfigurationChanged(configuration); } } } @Override public void onConfigurationChanged(Configuration newParentConfig) { prepareFreezingTaskBounds(); Loading