Loading quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +17 −12 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYS import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TRACING_ENABLED; import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.PendingIntent; import android.app.RemoteAction; import android.app.Service; Loading Loading @@ -487,13 +488,13 @@ public class TouchInteractionService extends Service implements PluginListener<O ActiveGestureLog.INSTANCE.addLog("setInputConsumer: " + mConsumer.getName()); mUncheckedConsumer = mConsumer; } else if (mDeviceState.isUserUnlocked() && mDeviceState.isFullyGesturalNavMode() && mDeviceState.canTriggerAssistantAction(event)) { } else if (mDeviceState.isUserUnlocked() && mDeviceState.isFullyGesturalNavMode()) { newGestureState = createGestureState(); // Do not change mConsumer as if there is an ongoing QuickSwitch gesture, we should // not interrupt it. QuickSwitch assumes that interruption can only happen if the // next gesture is also quick switch. ActivityManager.RunningTaskInfo runningTask = newGestureState.getRunningTask(); if (mDeviceState.canTriggerAssistantAction(event, runningTask)) { // Do not change mConsumer as if there is an ongoing QuickSwitch gesture, we // should not interrupt it. QuickSwitch assumes that interruption can only // happen if the next gesture is also quick switch. mUncheckedConsumer = new AssistantInputConsumer( this, newGestureState, Loading @@ -503,6 +504,10 @@ public class TouchInteractionService extends Service implements PluginListener<O newGestureState = DEFAULT_STATE; mUncheckedConsumer = InputConsumer.NO_OP; } } else { newGestureState = DEFAULT_STATE; mUncheckedConsumer = InputConsumer.NO_OP; } // Save the current gesture state mGestureState = newGestureState; Loading Loading @@ -572,7 +577,7 @@ public class TouchInteractionService extends Service implements PluginListener<O handleOrientationSetup(base); } if (mDeviceState.isFullyGesturalNavMode()) { if (mDeviceState.canTriggerAssistantAction(event)) { if (mDeviceState.canTriggerAssistantAction(event, newGestureState.getRunningTask())) { base = new AssistantInputConsumer( this, newGestureState, Loading quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +5 −3 Original line number Diff line number Diff line Loading @@ -525,13 +525,15 @@ public class RecentsAnimationDeviceState implements /** * @param ev An ACTION_DOWN motion event * @return whether the given motion event can trigger the assistant. * @param task Info for the currently running task * @return whether the given motion event can trigger the assistant over the current task. */ public boolean canTriggerAssistantAction(MotionEvent ev) { public boolean canTriggerAssistantAction(MotionEvent ev, ActivityManager.RunningTaskInfo task) { return mAssistantAvailable && !QuickStepContract.isAssistantGestureDisabled(mSystemUiStateFlags) && mOrientationTouchTransformer.touchInAssistantRegion(ev) && !isLockToAppActive(); && !isLockToAppActive() && !isGestureBlockedActivity(task); } /** Loading Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +17 −12 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYS import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TRACING_ENABLED; import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.PendingIntent; import android.app.RemoteAction; import android.app.Service; Loading Loading @@ -487,13 +488,13 @@ public class TouchInteractionService extends Service implements PluginListener<O ActiveGestureLog.INSTANCE.addLog("setInputConsumer: " + mConsumer.getName()); mUncheckedConsumer = mConsumer; } else if (mDeviceState.isUserUnlocked() && mDeviceState.isFullyGesturalNavMode() && mDeviceState.canTriggerAssistantAction(event)) { } else if (mDeviceState.isUserUnlocked() && mDeviceState.isFullyGesturalNavMode()) { newGestureState = createGestureState(); // Do not change mConsumer as if there is an ongoing QuickSwitch gesture, we should // not interrupt it. QuickSwitch assumes that interruption can only happen if the // next gesture is also quick switch. ActivityManager.RunningTaskInfo runningTask = newGestureState.getRunningTask(); if (mDeviceState.canTriggerAssistantAction(event, runningTask)) { // Do not change mConsumer as if there is an ongoing QuickSwitch gesture, we // should not interrupt it. QuickSwitch assumes that interruption can only // happen if the next gesture is also quick switch. mUncheckedConsumer = new AssistantInputConsumer( this, newGestureState, Loading @@ -503,6 +504,10 @@ public class TouchInteractionService extends Service implements PluginListener<O newGestureState = DEFAULT_STATE; mUncheckedConsumer = InputConsumer.NO_OP; } } else { newGestureState = DEFAULT_STATE; mUncheckedConsumer = InputConsumer.NO_OP; } // Save the current gesture state mGestureState = newGestureState; Loading Loading @@ -572,7 +577,7 @@ public class TouchInteractionService extends Service implements PluginListener<O handleOrientationSetup(base); } if (mDeviceState.isFullyGesturalNavMode()) { if (mDeviceState.canTriggerAssistantAction(event)) { if (mDeviceState.canTriggerAssistantAction(event, newGestureState.getRunningTask())) { base = new AssistantInputConsumer( this, newGestureState, Loading
quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +5 −3 Original line number Diff line number Diff line Loading @@ -525,13 +525,15 @@ public class RecentsAnimationDeviceState implements /** * @param ev An ACTION_DOWN motion event * @return whether the given motion event can trigger the assistant. * @param task Info for the currently running task * @return whether the given motion event can trigger the assistant over the current task. */ public boolean canTriggerAssistantAction(MotionEvent ev) { public boolean canTriggerAssistantAction(MotionEvent ev, ActivityManager.RunningTaskInfo task) { return mAssistantAvailable && !QuickStepContract.isAssistantGestureDisabled(mSystemUiStateFlags) && mOrientationTouchTransformer.touchInAssistantRegion(ev) && !isLockToAppActive(); && !isLockToAppActive() && !isGestureBlockedActivity(task); } /** Loading