diff options
| author | 2016-05-09 18:22:28 +0000 | |
|---|---|---|
| committer | 2016-05-09 18:22:29 +0000 | |
| commit | de5a7afc7989ecef051635fdc9ae52a69870c026 (patch) | |
| tree | ad93f2fab421f97c14ddd0228deb10191c7c1e46 | |
| parent | 8a111f5f20fcfe6707aa7bf02fde4f876e5505eb (diff) | |
| parent | a5434dd987ca976d677e5e247e35ccca529338d2 (diff) | |
Merge "Don't include IME in app screenshot while in multi-window mode" into nyc-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 5a394d03f3ab..be888fed80bc 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -6150,12 +6150,19 @@ public class WindowManagerService extends IWindowManager.Stub WindowState appWin = null; - boolean appIsImTarget; + boolean includeImeInScreenshot; synchronized(mWindowMap) { - appIsImTarget = mInputMethodTarget != null - && mInputMethodTarget.mAppToken != null - && mInputMethodTarget.mAppToken.appToken != null - && mInputMethodTarget.mAppToken.appToken.asBinder() == appToken; + final AppWindowToken imeTargetAppToken = + mInputMethodTarget != null ? mInputMethodTarget.mAppToken : null; + // We only include the Ime in the screenshot if the app we are screenshoting is the IME + // target and isn't in multi-window mode. We don't screenshot the IME in multi-window + // mode because the frame of the IME might not overlap with that of the app. + // E.g. IME target app at the top in split-screen mode and the IME at the bottom + // overlapping with the bottom app. + includeImeInScreenshot = imeTargetAppToken != null + && imeTargetAppToken.appToken != null + && imeTargetAppToken.appToken.asBinder() == appToken + && !mInputMethodTarget.isInMultiWindowMode(); } final int aboveAppLayer = (mPolicy.windowTypeToLayerLw(TYPE_APPLICATION) + 1) @@ -6174,7 +6181,7 @@ public class WindowManagerService extends IWindowManager.Stub continue; } if (ws.mIsImWindow) { - if (!appIsImTarget) { + if (!includeImeInScreenshot) { continue; } } else if (ws.mIsWallpaper) { |