Merge "Allow trackpad gestures in immersive mode ignoring bar visibility" into udc-qpr-dev

This commit is contained in:
Tracy Zhou
2023-06-23 22:58:53 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 3 deletions
@@ -338,8 +338,16 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener {
boolean canStartWithNavHidden = (mSystemUiStateFlags & SYSUI_STATE_NAV_BAR_HIDDEN) == 0
|| (mSystemUiStateFlags & SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY) != 0
|| mRotationTouchHelper.isTaskListFrozen();
return canStartWithNavHidden
&& (mSystemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) == 0
return canStartWithNavHidden && canStartTrackpadGesture();
}
/**
* @return whether SystemUI is in a state where we can start a system gesture from the trackpad.
* Trackpad gestures can start even when the nav bar / task bar is hidden in sticky immersive
* mode.
*/
public boolean canStartTrackpadGesture() {
return (mSystemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) == 0
&& (mSystemUiStateFlags & SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING) == 0
&& (mSystemUiStateFlags & SYSUI_STATE_QUICK_SETTINGS_EXPANDED) == 0
&& (mSystemUiStateFlags & SYSUI_STATE_MAGNIFICATION_OVERLAP) == 0
@@ -847,7 +847,9 @@ public class TouchInteractionService extends Service
return consumer;
}
boolean canStartSystemGesture = mDeviceState.canStartSystemGesture();
boolean canStartSystemGesture =
mGestureState.isTrackpadGesture() ? mDeviceState.canStartTrackpadGesture()
: mDeviceState.canStartSystemGesture();
if (!LockedUserState.get(this).isUserUnlocked()) {
CompoundString reasonString = newCompoundString("device locked");