Merge "Disable task snapshot when image size is invalid"

This commit is contained in:
TreeHugger Robot
2017-08-15 18:43:07 +00:00
committed by Android (Google) Code Review

View File

@@ -204,7 +204,7 @@ class TaskSnapshotController {
}
final GraphicBuffer buffer = top.mDisplayContent.screenshotApplicationsToBuffer(top.token,
-1, -1, false, 1.0f, false, true);
if (buffer == null) {
if (buffer == null || buffer.getWidth() <= 1 || buffer.getHeight() <= 1) {
return null;
}
return new TaskSnapshot(buffer, top.getConfiguration().orientation,