Merge "ScreenDecor: Set touchable region in windows coordinate space" into pi-dev

am: befd06af14

Change-Id: I12cb6febe20f01991a57bf52c78584dda1b62dc7
This commit is contained in:
Adrian Roos
2018-05-16 10:34:29 -07:00
committed by android-build-merger

View File

@@ -554,7 +554,18 @@ public class ScreenDecorations extends SystemUI implements Tunable {
return null;
}
return mInfo.displayCutout.getBounds();
View rootView = getRootView();
Region cutoutBounds = mInfo.displayCutout.getBounds();
// Transform to window's coordinate space
rootView.getLocationOnScreen(mLocation);
cutoutBounds.translate(-mLocation[0], -mLocation[1]);
// Intersect with window's frame
cutoutBounds.op(rootView.getLeft(), rootView.getTop(), rootView.getRight(),
rootView.getBottom(), Region.Op.INTERSECT);
return cutoutBounds;
}
}
}