diff options
| author | 2017-06-01 15:12:42 +0000 | |
|---|---|---|
| committer | 2017-06-01 15:12:42 +0000 | |
| commit | 660e70e63ab349b5fbe7389e54008cee0ffb51cf (patch) | |
| tree | 20443b15dfbfe31fc16143ee90812772f12a1e98 | |
| parent | c56a0533be60bdd1c20047b7d599310995ce9418 (diff) | |
| parent | a30fdcb687c92cccbc21ba41a052d0bb311acd88 (diff) | |
Merge "Fix setRequestedOrientation() freeze on Android Wear." into oc-dev
am: a30fdcb687
Change-Id: I0046647f4f773acb06a1dcdb45d0499ee831ae2a
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index c92c36052e72..f3ecfeb40498 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -20180,6 +20180,11 @@ public class ActivityManagerService extends IActivityManager.Stub mTempConfig.setTo(getGlobalConfiguration()); final int changes = mTempConfig.updateFrom(values); if (changes == 0) { + // Since calling to Activity.setRequestedOrientation leads to freezing the window with + // 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. + performDisplayOverrideConfigUpdate(values, deferResume, DEFAULT_DISPLAY); return 0; } @@ -20368,20 +20373,19 @@ public class ActivityManagerService extends IActivityManager.Stub int displayId) { mTempConfig.setTo(mStackSupervisor.getDisplayOverrideConfiguration(displayId)); final int changes = mTempConfig.updateFrom(values); - if (changes == 0) { - return 0; - } - - Slog.i(TAG, "Override config changes=" + Integer.toHexString(changes) + " " + mTempConfig - + " for displayId=" + displayId); - mStackSupervisor.setDisplayOverrideConfiguration(mTempConfig, displayId); + if (changes != 0) { + Slog.i(TAG, "Override config changes=" + Integer.toHexString(changes) + " " + + mTempConfig + " for displayId=" + displayId); + mStackSupervisor.setDisplayOverrideConfiguration(mTempConfig, displayId); - final boolean isDensityChange = (changes & ActivityInfo.CONFIG_DENSITY) != 0; - if (isDensityChange && displayId == DEFAULT_DISPLAY) { - // Reset the unsupported display size dialog. - mUiHandler.sendEmptyMessage(SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG); + final boolean isDensityChange = (changes & ActivityInfo.CONFIG_DENSITY) != 0; + if (isDensityChange && displayId == DEFAULT_DISPLAY) { + // Reset the unsupported display size dialog. + mUiHandler.sendEmptyMessage(SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG); - killAllBackgroundProcessesExcept(N, ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE); + killAllBackgroundProcessesExcept(N, + ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE); + } } // Update the configuration with WM first and check if any of the stacks need to be resized |