Skip drawing snapshot if we can't create the buffer.

Bug: 63436798
Test: Only a NPE check
Change-Id: I1c87d9dfcf828e3c7d4fb070e7492834761224e7
This commit is contained in:
Winson Chung
2017-10-06 14:01:10 -07:00
parent 7c112b733c
commit 6267f9955f

View File

@@ -296,7 +296,9 @@ class TaskSnapshotController {
decorPainter.drawDecors(c, null /* statusBarExcludeFrame */);
node.end(c);
final Bitmap hwBitmap = ThreadedRenderer.createHardwareBitmap(node, width, height);
if (hwBitmap == null) {
return null;
}
return new TaskSnapshot(hwBitmap.createGraphicBufferHandle(),
topChild.getConfiguration().orientation, mainWindow.mStableInsets,
ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */);