Do not pass invalid bounds for dim layer

Makes the entire system freeze.

Bug: 26396656
Change-Id: I9e9b0a297a351cd8ef72cdc8f5994df6c42567d9
This commit is contained in:
Jorim Jaggi
2016-01-05 15:32:34 +01:00
parent 2a37455a28
commit 7b371ddfbd

View File

@@ -172,12 +172,18 @@ public class DockedStackDividerController implements DimLayerUser {
void setResizeDimLayer(boolean visible, int targetStackId, float alpha) {
SurfaceControl.openTransaction();
TaskStack stack = mDisplayContent.mService.mStackIdToStack.get(targetStackId);
if (visible && stack != null) {
boolean visibleAndValid = visible && stack != null;
if (visibleAndValid) {
stack.getDimBounds(mTmpRect);
mDimLayer.setBounds(mTmpRect);
mDimLayer.show(mDisplayContent.mService.mLayersController.getResizeDimLayer(), alpha,
0 /* duration */);
} else {
if (mTmpRect.height() > 0) {
mDimLayer.setBounds(mTmpRect);
mDimLayer.show(mDisplayContent.mService.mLayersController.getResizeDimLayer(),
alpha, 0 /* duration */);
} else {
visibleAndValid = false;
}
}
if (!visibleAndValid) {
mDimLayer.hide();
}
SurfaceControl.closeTransaction();