diff options
| author | 2018-11-17 00:16:43 +0000 | |
|---|---|---|
| committer | 2018-11-17 00:16:43 +0000 | |
| commit | 22b4fc7c3cb71cc5d6e58ea7e4e78df8e613ac4b (patch) | |
| tree | f028b31ef096617cd54955b367b650e97de9d952 | |
| parent | e6c773066b9a05adcbd1acfed9afe8b5de4e2a1c (diff) | |
| parent | 52ef1bf893e27da84c179b91fa864ecb73f809c7 (diff) | |
Merge "Fix system circular wait during top display focus change"
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index d7d3e714eb81..c47b22fd4082 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -4402,22 +4402,24 @@ public class WindowManagerService extends IWindowManager.Stub lastFocus = displayContent.mLastFocus; newFocus = displayContent.mCurrentFocus; - if (lastFocus == newFocus) { - // Report focus to ViewRootImpl when top focused display changes. - // Or, nothing to do for no window focus change. - if (topFocusedDisplayChanged && newFocus != null) { - if (DEBUG_FOCUS_LIGHT) { - Slog.d(TAG, "Reporting focus: " + newFocus - + " due to top focused display change."); - } - // See {@link IWindow#windowFocusChanged} to know why set - // reportToClient as false. - newFocus.reportFocusChangedSerialized(true, mInTouchMode, - false /* reportToClient */); - notifyFocusChanged(); + } + if (lastFocus == newFocus) { + // Report focus to ViewRootImpl when top focused display changes. + // Or, nothing to do for no window focus change. + if (topFocusedDisplayChanged && newFocus != null) { + if (DEBUG_FOCUS_LIGHT) { + Slog.d(TAG, "Reporting focus: " + newFocus + + " due to top focused display change."); } - return; + // See {@link IWindow#windowFocusChanged} to know why set + // reportToClient as false. + newFocus.reportFocusChangedSerialized(true, mInTouchMode, + false /* reportToClient */); + notifyFocusChanged(); } + return; + } + synchronized (mGlobalLock) { displayContent.mLastFocus = newFocus; if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Focus moving from " + lastFocus + " to " + newFocus + " displayId=" + displayContent.getDisplayId()); |