Merge "Explicitly exclude IME from Task Snapshots" into rvc-dev am: 7e06b011a0

Change-Id: Id1e383895f190e7430e29f9f803881bf10cad689
This commit is contained in:
Automerger Merge Worker
2020-03-17 18:10:24 +00:00
2 changed files with 13 additions and 3 deletions

View File

@@ -1960,7 +1960,7 @@ public final class SurfaceControl implements Parcelable {
* @hide
*/
public static ScreenshotGraphicBuffer captureLayersExcluding(SurfaceControl layer,
Rect sourceCrop, float frameScale, SurfaceControl[] exclude) {
Rect sourceCrop, float frameScale, int format, SurfaceControl[] exclude) {
final IBinder displayToken = SurfaceControl.getInternalDisplayToken();
long[] nativeExcludeObjects = new long[exclude.length];
for (int i = 0; i < exclude.length; i++) {

View File

@@ -352,9 +352,19 @@ class TaskSnapshotController {
}
task.getBounds(mTmpRect);
mTmpRect.offsetTo(0, 0);
SurfaceControl[] excludeLayers;
final WindowState imeWindow = task.getDisplayContent().mInputMethodWindow;
if (imeWindow != null) {
excludeLayers = new SurfaceControl[1];
excludeLayers[0] = imeWindow.getSurfaceControl();
} else {
excludeLayers = new SurfaceControl[0];
}
final SurfaceControl.ScreenshotGraphicBuffer screenshotBuffer =
SurfaceControl.captureLayers(
task.getSurfaceControl(), mTmpRect, scaleFraction, pixelFormat);
SurfaceControl.captureLayersExcluding(
task.getSurfaceControl(), mTmpRect, scaleFraction,
pixelFormat, excludeLayers);
if (outTaskSize != null) {
outTaskSize.x = mTmpRect.width();
outTaskSize.y = mTmpRect.height();