Merge "DO NOT MERGE Fix the cutout of magnification border" into sc-v2-dev

This commit is contained in:
Ryan Lin
2021-11-03 05:24:27 +00:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 0 deletions
@@ -510,4 +510,20 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
protected boolean isUserSetupComplete() {
return mIsUserSetupComplete;
}
/**
* Called when we determine the touchable region.
*
* @param exclude {@code true} then the magnification region computation will omit the window.
*/
public void excludeFromMagnificationRegion(boolean exclude) {
if (exclude) {
mWindowLayoutParams.privateFlags |=
WindowManager.LayoutParams.PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION;
} else {
mWindowLayoutParams.privateFlags &=
~WindowManager.LayoutParams.PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION;
}
mWindowManager.updateViewLayout(mDragLayer, mWindowLayoutParams);
}
}
@@ -137,12 +137,14 @@ public class TaskbarDragLayerController {
// Always have nav buttons be touchable
mControllers.navbarButtonsViewController.addVisibleButtonsRegion(
mTaskbarDragLayer, insetsInfo.touchableRegion);
boolean insetsIsTouchableRegion = true;
if (mTaskbarDragLayer.getAlpha() < AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD) {
// Let touches pass through us.
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
} else if (mControllers.navbarButtonsViewController.isImeVisible()) {
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_CONTENT);
insetsIsTouchableRegion = false;
} else if (!mControllers.uiController.isTaskbarTouchable()) {
// Let touches pass through us.
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
@@ -151,9 +153,11 @@ public class TaskbarDragLayerController {
// Taskbar has some touchable elements, take over the full taskbar area
insetsInfo.setTouchableInsets(mActivity.isTaskbarWindowFullscreen()
? TOUCHABLE_INSETS_FRAME : TOUCHABLE_INSETS_CONTENT);
insetsIsTouchableRegion = false;
} else {
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
}
mActivity.excludeFromMagnificationRegion(insetsIsTouchableRegion);
}
/**