Loading quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +5 −5 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten protected float mDragLengthFactor = 1; protected final Context mContext; protected final RecentsAnimationDeviceState mDeviceState; protected final GestureState mGestureState; protected final OverviewComponentObserver mOverviewComponentObserver; protected final BaseActivityInterface<T> mActivityInterface; Loading @@ -106,7 +107,6 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten protected final TransformParams mTransformParams = new TransformParams(); private final Vibrator mVibrator; protected final Mode mMode; // Shift in the range of [0, 1]. // 0 => preview snapShot is completely visible, and hotseat is completely translated down Loading Loading @@ -135,10 +135,11 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten protected boolean mCanceled; protected int mFinishingRecentsAnimationForNewTaskId = -1; protected BaseSwipeUpHandler(Context context, GestureState gestureState, OverviewComponentObserver overviewComponentObserver, protected BaseSwipeUpHandler(Context context, RecentsAnimationDeviceState deviceState, GestureState gestureState, OverviewComponentObserver overviewComponentObserver, RecentsModel recentsModel, InputConsumerController inputConsumer, int runningTaskId) { mContext = context; mDeviceState = deviceState; mGestureState = gestureState; mOverviewComponentObserver = overviewComponentObserver; mActivityInterface = gestureState.getActivityInterface(); Loading @@ -147,7 +148,6 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten mActivityInterface.createActivityInitListener(this::onActivityInit); mRunningTaskId = runningTaskId; mInputConsumer = inputConsumer; mMode = SysUINavigationMode.getMode(context); mAppWindowAnimationHelper = new AppWindowAnimationHelper(context); mPageSpacing = context.getResources().getDimensionPixelSize(R.dimen.recents_page_spacing); Loading Loading @@ -348,7 +348,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten mAppWindowAnimationHelper.updateHomeBounds(getStackBounds(dp)); } mAppWindowAnimationHelper.updateTargetRect(TEMP_RECT); if (mMode == Mode.NO_BUTTON) { if (mDeviceState.isFullyGesturalNavMode()) { // We can drag all the way to the top of the screen. mDragLengthFactor = (float) dp.heightPx / mTransitionDragLength; } Loading quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +20 −27 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ import com.android.launcher3.provider.RestoreDbTask; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper; import com.android.launcher3.util.TraceHelper; import com.android.quickstep.SysUINavigationMode.Mode; import com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener; import com.android.quickstep.inputconsumers.AccessibilityInputConsumer; import com.android.quickstep.inputconsumers.AssistantInputConsumer; import com.android.quickstep.inputconsumers.DeviceLockedInputConsumer; Loading Loading @@ -114,8 +112,7 @@ class ArgList extends LinkedList<String> { * Service connected by system-UI for handling touch interaction. */ @TargetApi(Build.VERSION_CODES.Q) public class TouchInteractionService extends Service implements NavigationModeChangeListener, PluginListener<OverscrollPlugin> { public class TouchInteractionService extends Service implements PluginListener<OverscrollPlugin> { private static final String TAG = "TouchInteractionService"; Loading Loading @@ -269,20 +266,18 @@ public class TouchInteractionService extends Service implements private InputMonitorCompat mInputMonitorCompat; private InputEventReceiver mInputEventReceiver; private Mode mMode = Mode.THREE_BUTTONS; @Override public void onCreate() { super.onCreate(); mDeviceState = new RecentsAnimationDeviceState(this); mDeviceState.runOnUserUnlocked(this::onUserUnlocked); // Initialize anything here that is needed in direct boot mode. // Everything else should be initialized in onUserUnlocked() below. mMainChoreographer = Choreographer.getInstance(); mAM = ActivityManagerWrapper.getInstance(); mDeviceState = new RecentsAnimationDeviceState(this); mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged); mDeviceState.runOnUserUnlocked(this::onUserUnlocked); onNavigationModeChanged(SysUINavigationMode.INSTANCE.get(this).addModeChangeListener(this)); sConnected = true; PluginManagerWrapper.INSTANCE.get(getBaseContext()).addPluginListener(this, Loading @@ -308,7 +303,7 @@ public class TouchInteractionService extends Service implements Log.d(TestProtocol.NO_BACKGROUND_TO_OVERVIEW_TAG, "initInputMonitor 1"); } disposeEventHandlers(); if (!mMode.hasGestures || !SystemUiProxy.INSTANCE.get(this).isActive()) { if (mDeviceState.isButtonNavMode() || !SystemUiProxy.INSTANCE.get(this).isActive()) { return; } if (TestProtocol.sDebugTracing) { Loading @@ -327,12 +322,10 @@ public class TouchInteractionService extends Service implements mDeviceState.updateGestureTouchRegions(); } @Override public void onNavigationModeChanged(Mode newMode) { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_BACKGROUND_TO_OVERVIEW_TAG, "onNavigationModeChanged " + newMode); } mMode = newMode; /** * Called when the navigation mode changes, guaranteed to be after the device state has updated. */ private void onNavigationModeChanged(SysUINavigationMode.Mode mode) { initInputMonitor(); resetHomeBounceSeenOnQuickstepEnabledFirstTime(); } Loading Loading @@ -369,7 +362,7 @@ public class TouchInteractionService extends Service implements } private void resetHomeBounceSeenOnQuickstepEnabledFirstTime() { if (!mDeviceState.isUserUnlocked() || !mMode.hasGestures) { if (!mDeviceState.isUserUnlocked() || mDeviceState.isButtonNavMode()) { // Skip if not yet unlocked (can't read user shared prefs) or if the current navigation // mode doesn't have gestures return; Loading Loading @@ -417,7 +410,6 @@ public class TouchInteractionService extends Service implements } disposeEventHandlers(); mDeviceState.destroy(); SysUINavigationMode.INSTANCE.get(this).removeModeChangeListener(this); SystemUiProxy.INSTANCE.get(this).setProxy(null); sConnected = false; Loading Loading @@ -453,7 +445,8 @@ public class TouchInteractionService extends Service implements ActiveGestureLog.INSTANCE.addLog("setInputConsumer", mConsumer.getType()); mUncheckedConsumer = mConsumer; } else if (mDeviceState.isUserUnlocked() && mMode == Mode.NO_BUTTON } else if (mDeviceState.isUserUnlocked() && mDeviceState.isFullyGesturalNavMode() && mDeviceState.canTriggerAssistantAction(event)) { // 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 Loading Loading @@ -494,7 +487,7 @@ public class TouchInteractionService extends Service implements || previousGestureState.isRecentsAnimationRunning() ? newBaseConsumer(previousGestureState, newGestureState, event) : mResetGestureInputConsumer; if (mMode == Mode.NO_BUTTON) { if (mDeviceState.isFullyGesturalNavMode()) { if (mDeviceState.canTriggerAssistantAction(event)) { base = new AssistantInputConsumer(this, newGestureState, base, mInputMonitorCompat); } Loading Loading @@ -584,7 +577,8 @@ public class TouchInteractionService extends Service implements final boolean shouldDefer; final BaseSwipeUpHandler.Factory factory; if (mMode == Mode.NO_BUTTON && !mOverviewComponentObserver.isHomeAndOverviewSame()) { if (mDeviceState.isFullyGesturalNavMode() && !mOverviewComponentObserver.isHomeAndOverviewSame()) { shouldDefer = previousGestureState.getFinishingRecentsAnimationTaskId() < 0; factory = mFallbackNoButtonFactory; } else { Loading @@ -601,7 +595,7 @@ public class TouchInteractionService extends Service implements private InputConsumer createDeviceLockedInputConsumer(GestureState gestureState, RunningTaskInfo taskInfo) { if (mMode == Mode.NO_BUTTON && taskInfo != null) { if (mDeviceState.isFullyGesturalNavMode() && taskInfo != null) { return new DeviceLockedInputConsumer(this, mDeviceState, mTaskAnimationManager, gestureState, mInputMonitorCompat, taskInfo.taskId); } else { Loading Loading @@ -641,7 +635,7 @@ public class TouchInteractionService extends Service implements if (!mDeviceState.isUserUnlocked()) { return; } if (!mMode.hasGestures && !mOverviewComponentObserver.isHomeAndOverviewSame()) { if (mDeviceState.isButtonNavMode() && !mOverviewComponentObserver.isHomeAndOverviewSame()) { // Prevent the overview from being started before the real home on first boot. return; } Loading Loading @@ -708,7 +702,6 @@ public class TouchInteractionService extends Service implements // Dump everything mDeviceState.dump(pw); pw.println("TouchState:"); pw.println(" navMode=" + mMode); boolean resumed = mOverviewComponentObserver != null && mOverviewComponentObserver.getActivityInterface().isResumed(); pw.println(" resumed=" + resumed); Loading Loading @@ -748,9 +741,9 @@ public class TouchInteractionService extends Service implements private BaseSwipeUpHandler createFallbackNoButtonSwipeHandler(GestureState gestureState, RunningTaskInfo runningTask, long touchTimeMs, boolean continuingLastGesture, boolean isLikelyToStartNewTask) { return new FallbackNoButtonInputConsumer(this, gestureState, mOverviewComponentObserver, runningTask, mRecentsModel, mInputConsumer, isLikelyToStartNewTask, continuingLastGesture); return new FallbackNoButtonInputConsumer(this, mDeviceState, gestureState, mOverviewComponentObserver, runningTask, mRecentsModel, mInputConsumer, isLikelyToStartNewTask, continuingLastGesture); } protected boolean shouldNotifyBackGesture() { Loading quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +9 −13 Original line number Diff line number Diff line Loading @@ -157,9 +157,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> */ private static final int LOG_NO_OP_PAGE_INDEX = -1; private final RecentsAnimationDeviceState mDeviceState; private final TaskAnimationManager mTaskAnimationManager; private final GestureState mGestureState; // Either RectFSpringAnim (if animating home) or ObjectAnimator (from mCurrentShift) otherwise private RunningWindowAnim mRunningWindowAnim; Loading Loading @@ -198,11 +196,9 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> RunningTaskInfo runningTaskInfo, long touchTimeMs, OverviewComponentObserver overviewComponentObserver, boolean continuingLastGesture, InputConsumerController inputConsumer, RecentsModel recentsModel) { super(context, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); mDeviceState = deviceState; super(context, deviceState, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); mTaskAnimationManager = taskAnimationManager; mGestureState = gestureState; mTouchTimeMs = touchTimeMs; mContinuingLastGesture = continuingLastGesture; initStateCallbacks(); Loading Loading @@ -444,7 +440,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> * Note this method has no effect unless the navigation mode is NO_BUTTON. */ private void maybeUpdateRecentsAttachedState(boolean animate) { if (mMode != Mode.NO_BUTTON || mRecentsView == null) { if (!mDeviceState.isFullyGesturalNavMode() || mRecentsView == null) { return; } RemoteAnimationTargetCompat runningTaskTarget = mRecentsAnimationTargets == null Loading Loading @@ -546,7 +542,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> final boolean passed = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW; if (passed != mPassedOverviewThreshold) { mPassedOverviewThreshold = passed; if (mMode != Mode.NO_BUTTON) { if (!mDeviceState.isFullyGesturalNavMode()) { performHapticFeedback(); } } Loading Loading @@ -730,7 +726,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> if (!isFling) { if (isCancel) { endTarget = LAST_TASK; } else if (mMode == Mode.NO_BUTTON) { } else if (mDeviceState.isFullyGesturalNavMode()) { if (mIsShelfPeeking) { endTarget = RECENTS; } else if (goingToNewTask) { Loading @@ -751,9 +747,9 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> boolean willGoToNewTaskOnSwipeUp = goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity); if (mMode == Mode.NO_BUTTON && isSwipeUp && !willGoToNewTaskOnSwipeUp) { if (mDeviceState.isFullyGesturalNavMode() && isSwipeUp && !willGoToNewTaskOnSwipeUp) { endTarget = HOME; } else if (mMode == Mode.NO_BUTTON && isSwipeUp && !mIsShelfPeeking) { } else if (mDeviceState.isFullyGesturalNavMode() && isSwipeUp && !mIsShelfPeeking) { // If swiping at a diagonal, base end target on the faster velocity. endTarget = NEW_TASK; } else if (isSwipeUp) { Loading Loading @@ -793,7 +789,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> float minFlingVelocity = mContext.getResources() .getDimension(R.dimen.quickstep_fling_min_velocity); if (Math.abs(endVelocity) > minFlingVelocity && mTransitionDragLength > 0) { if (endTarget == RECENTS && mMode != Mode.NO_BUTTON) { if (endTarget == RECENTS && !mDeviceState.isFullyGesturalNavMode()) { Interpolators.OvershootParams overshoot = new Interpolators.OvershootParams( startShift, endShift, endShift, endVelocity / 1000, mTransitionDragLength, mContext); Loading Loading @@ -839,7 +835,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> } duration = Math.max(duration, mRecentsView.getScroller().getDuration()); } if (mMode == Mode.NO_BUTTON) { if (mDeviceState.isFullyGesturalNavMode()) { setShelfState(ShelfAnimState.OVERVIEW, interpolator, duration); } } else if (endTarget == NEW_TASK || endTarget == LAST_TASK) { Loading quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java +5 −4 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import com.android.quickstep.MultiStateCallback; import com.android.quickstep.OverviewComponentObserver; import com.android.quickstep.RecentsActivity; import com.android.quickstep.RecentsAnimationController; import com.android.quickstep.RecentsAnimationDeviceState; import com.android.quickstep.RecentsModel; import com.android.quickstep.fallback.FallbackRecentsView; import com.android.quickstep.util.RectFSpringAnim; Loading Loading @@ -112,13 +113,13 @@ public class FallbackNoButtonInputConsumer extends private final PointF mEndVelocityPxPerMs = new PointF(0, 0.5f); private RunningWindowAnim mFinishAnimation; public FallbackNoButtonInputConsumer(Context context, GestureState gestureState, OverviewComponentObserver overviewComponentObserver, public FallbackNoButtonInputConsumer(Context context, RecentsAnimationDeviceState deviceState, GestureState gestureState, OverviewComponentObserver overviewComponentObserver, RunningTaskInfo runningTaskInfo, RecentsModel recentsModel, InputConsumerController inputConsumer, boolean isLikelyToStartNewTask, boolean continuingLastGesture) { super(context, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); super(context, deviceState, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); mLauncherAlpha.value = 1; mRunningTaskInfo = runningTaskInfo; Loading quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +1 −5 Original line number Diff line number Diff line Loading @@ -54,8 +54,6 @@ import com.android.quickstep.GestureState; import com.android.quickstep.InputConsumer; import com.android.quickstep.RecentsAnimationCallbacks; import com.android.quickstep.RecentsAnimationDeviceState; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.SysUINavigationMode.Mode; import com.android.quickstep.TaskAnimationManager; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.CachedEventDispatcher; Loading Loading @@ -85,7 +83,6 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC private final CachedEventDispatcher mRecentsViewDispatcher = new CachedEventDispatcher(); private final RunningTaskInfo mRunningTask; private final InputMonitorCompat mInputMonitorCompat; private final SysUINavigationMode.Mode mMode; private final BaseActivityInterface mActivityInterface; private final BaseSwipeUpHandler.Factory mHandlerFactory; Loading Loading @@ -137,7 +134,6 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mGestureState = gestureState; mMainThreadHandler = new Handler(Looper.getMainLooper()); mRunningTask = runningTaskInfo; mMode = SysUINavigationMode.getMode(base); mHandlerFactory = handlerFactory; mActivityInterface = mGestureState.getActivityInterface(); Loading Loading @@ -293,7 +289,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mInteractionHandler.updateDisplacement(displacement - mStartDisplacement); } if (mMode == Mode.NO_BUTTON) { if (mDeviceState.isFullyGesturalNavMode()) { mMotionPauseDetector.setDisallowPause(upDist < mMotionPauseMinDisplacement || isLikelyToStartNewTask); mMotionPauseDetector.addPosition(displacement, ev.getEventTime()); Loading Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +5 −5 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten protected float mDragLengthFactor = 1; protected final Context mContext; protected final RecentsAnimationDeviceState mDeviceState; protected final GestureState mGestureState; protected final OverviewComponentObserver mOverviewComponentObserver; protected final BaseActivityInterface<T> mActivityInterface; Loading @@ -106,7 +107,6 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten protected final TransformParams mTransformParams = new TransformParams(); private final Vibrator mVibrator; protected final Mode mMode; // Shift in the range of [0, 1]. // 0 => preview snapShot is completely visible, and hotseat is completely translated down Loading Loading @@ -135,10 +135,11 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten protected boolean mCanceled; protected int mFinishingRecentsAnimationForNewTaskId = -1; protected BaseSwipeUpHandler(Context context, GestureState gestureState, OverviewComponentObserver overviewComponentObserver, protected BaseSwipeUpHandler(Context context, RecentsAnimationDeviceState deviceState, GestureState gestureState, OverviewComponentObserver overviewComponentObserver, RecentsModel recentsModel, InputConsumerController inputConsumer, int runningTaskId) { mContext = context; mDeviceState = deviceState; mGestureState = gestureState; mOverviewComponentObserver = overviewComponentObserver; mActivityInterface = gestureState.getActivityInterface(); Loading @@ -147,7 +148,6 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten mActivityInterface.createActivityInitListener(this::onActivityInit); mRunningTaskId = runningTaskId; mInputConsumer = inputConsumer; mMode = SysUINavigationMode.getMode(context); mAppWindowAnimationHelper = new AppWindowAnimationHelper(context); mPageSpacing = context.getResources().getDimensionPixelSize(R.dimen.recents_page_spacing); Loading Loading @@ -348,7 +348,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten mAppWindowAnimationHelper.updateHomeBounds(getStackBounds(dp)); } mAppWindowAnimationHelper.updateTargetRect(TEMP_RECT); if (mMode == Mode.NO_BUTTON) { if (mDeviceState.isFullyGesturalNavMode()) { // We can drag all the way to the top of the screen. mDragLengthFactor = (float) dp.heightPx / mTransitionDragLength; } Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +20 −27 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ import com.android.launcher3.provider.RestoreDbTask; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper; import com.android.launcher3.util.TraceHelper; import com.android.quickstep.SysUINavigationMode.Mode; import com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener; import com.android.quickstep.inputconsumers.AccessibilityInputConsumer; import com.android.quickstep.inputconsumers.AssistantInputConsumer; import com.android.quickstep.inputconsumers.DeviceLockedInputConsumer; Loading Loading @@ -114,8 +112,7 @@ class ArgList extends LinkedList<String> { * Service connected by system-UI for handling touch interaction. */ @TargetApi(Build.VERSION_CODES.Q) public class TouchInteractionService extends Service implements NavigationModeChangeListener, PluginListener<OverscrollPlugin> { public class TouchInteractionService extends Service implements PluginListener<OverscrollPlugin> { private static final String TAG = "TouchInteractionService"; Loading Loading @@ -269,20 +266,18 @@ public class TouchInteractionService extends Service implements private InputMonitorCompat mInputMonitorCompat; private InputEventReceiver mInputEventReceiver; private Mode mMode = Mode.THREE_BUTTONS; @Override public void onCreate() { super.onCreate(); mDeviceState = new RecentsAnimationDeviceState(this); mDeviceState.runOnUserUnlocked(this::onUserUnlocked); // Initialize anything here that is needed in direct boot mode. // Everything else should be initialized in onUserUnlocked() below. mMainChoreographer = Choreographer.getInstance(); mAM = ActivityManagerWrapper.getInstance(); mDeviceState = new RecentsAnimationDeviceState(this); mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged); mDeviceState.runOnUserUnlocked(this::onUserUnlocked); onNavigationModeChanged(SysUINavigationMode.INSTANCE.get(this).addModeChangeListener(this)); sConnected = true; PluginManagerWrapper.INSTANCE.get(getBaseContext()).addPluginListener(this, Loading @@ -308,7 +303,7 @@ public class TouchInteractionService extends Service implements Log.d(TestProtocol.NO_BACKGROUND_TO_OVERVIEW_TAG, "initInputMonitor 1"); } disposeEventHandlers(); if (!mMode.hasGestures || !SystemUiProxy.INSTANCE.get(this).isActive()) { if (mDeviceState.isButtonNavMode() || !SystemUiProxy.INSTANCE.get(this).isActive()) { return; } if (TestProtocol.sDebugTracing) { Loading @@ -327,12 +322,10 @@ public class TouchInteractionService extends Service implements mDeviceState.updateGestureTouchRegions(); } @Override public void onNavigationModeChanged(Mode newMode) { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.NO_BACKGROUND_TO_OVERVIEW_TAG, "onNavigationModeChanged " + newMode); } mMode = newMode; /** * Called when the navigation mode changes, guaranteed to be after the device state has updated. */ private void onNavigationModeChanged(SysUINavigationMode.Mode mode) { initInputMonitor(); resetHomeBounceSeenOnQuickstepEnabledFirstTime(); } Loading Loading @@ -369,7 +362,7 @@ public class TouchInteractionService extends Service implements } private void resetHomeBounceSeenOnQuickstepEnabledFirstTime() { if (!mDeviceState.isUserUnlocked() || !mMode.hasGestures) { if (!mDeviceState.isUserUnlocked() || mDeviceState.isButtonNavMode()) { // Skip if not yet unlocked (can't read user shared prefs) or if the current navigation // mode doesn't have gestures return; Loading Loading @@ -417,7 +410,6 @@ public class TouchInteractionService extends Service implements } disposeEventHandlers(); mDeviceState.destroy(); SysUINavigationMode.INSTANCE.get(this).removeModeChangeListener(this); SystemUiProxy.INSTANCE.get(this).setProxy(null); sConnected = false; Loading Loading @@ -453,7 +445,8 @@ public class TouchInteractionService extends Service implements ActiveGestureLog.INSTANCE.addLog("setInputConsumer", mConsumer.getType()); mUncheckedConsumer = mConsumer; } else if (mDeviceState.isUserUnlocked() && mMode == Mode.NO_BUTTON } else if (mDeviceState.isUserUnlocked() && mDeviceState.isFullyGesturalNavMode() && mDeviceState.canTriggerAssistantAction(event)) { // 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 Loading Loading @@ -494,7 +487,7 @@ public class TouchInteractionService extends Service implements || previousGestureState.isRecentsAnimationRunning() ? newBaseConsumer(previousGestureState, newGestureState, event) : mResetGestureInputConsumer; if (mMode == Mode.NO_BUTTON) { if (mDeviceState.isFullyGesturalNavMode()) { if (mDeviceState.canTriggerAssistantAction(event)) { base = new AssistantInputConsumer(this, newGestureState, base, mInputMonitorCompat); } Loading Loading @@ -584,7 +577,8 @@ public class TouchInteractionService extends Service implements final boolean shouldDefer; final BaseSwipeUpHandler.Factory factory; if (mMode == Mode.NO_BUTTON && !mOverviewComponentObserver.isHomeAndOverviewSame()) { if (mDeviceState.isFullyGesturalNavMode() && !mOverviewComponentObserver.isHomeAndOverviewSame()) { shouldDefer = previousGestureState.getFinishingRecentsAnimationTaskId() < 0; factory = mFallbackNoButtonFactory; } else { Loading @@ -601,7 +595,7 @@ public class TouchInteractionService extends Service implements private InputConsumer createDeviceLockedInputConsumer(GestureState gestureState, RunningTaskInfo taskInfo) { if (mMode == Mode.NO_BUTTON && taskInfo != null) { if (mDeviceState.isFullyGesturalNavMode() && taskInfo != null) { return new DeviceLockedInputConsumer(this, mDeviceState, mTaskAnimationManager, gestureState, mInputMonitorCompat, taskInfo.taskId); } else { Loading Loading @@ -641,7 +635,7 @@ public class TouchInteractionService extends Service implements if (!mDeviceState.isUserUnlocked()) { return; } if (!mMode.hasGestures && !mOverviewComponentObserver.isHomeAndOverviewSame()) { if (mDeviceState.isButtonNavMode() && !mOverviewComponentObserver.isHomeAndOverviewSame()) { // Prevent the overview from being started before the real home on first boot. return; } Loading Loading @@ -708,7 +702,6 @@ public class TouchInteractionService extends Service implements // Dump everything mDeviceState.dump(pw); pw.println("TouchState:"); pw.println(" navMode=" + mMode); boolean resumed = mOverviewComponentObserver != null && mOverviewComponentObserver.getActivityInterface().isResumed(); pw.println(" resumed=" + resumed); Loading Loading @@ -748,9 +741,9 @@ public class TouchInteractionService extends Service implements private BaseSwipeUpHandler createFallbackNoButtonSwipeHandler(GestureState gestureState, RunningTaskInfo runningTask, long touchTimeMs, boolean continuingLastGesture, boolean isLikelyToStartNewTask) { return new FallbackNoButtonInputConsumer(this, gestureState, mOverviewComponentObserver, runningTask, mRecentsModel, mInputConsumer, isLikelyToStartNewTask, continuingLastGesture); return new FallbackNoButtonInputConsumer(this, mDeviceState, gestureState, mOverviewComponentObserver, runningTask, mRecentsModel, mInputConsumer, isLikelyToStartNewTask, continuingLastGesture); } protected boolean shouldNotifyBackGesture() { Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +9 −13 Original line number Diff line number Diff line Loading @@ -157,9 +157,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> */ private static final int LOG_NO_OP_PAGE_INDEX = -1; private final RecentsAnimationDeviceState mDeviceState; private final TaskAnimationManager mTaskAnimationManager; private final GestureState mGestureState; // Either RectFSpringAnim (if animating home) or ObjectAnimator (from mCurrentShift) otherwise private RunningWindowAnim mRunningWindowAnim; Loading Loading @@ -198,11 +196,9 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> RunningTaskInfo runningTaskInfo, long touchTimeMs, OverviewComponentObserver overviewComponentObserver, boolean continuingLastGesture, InputConsumerController inputConsumer, RecentsModel recentsModel) { super(context, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); mDeviceState = deviceState; super(context, deviceState, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); mTaskAnimationManager = taskAnimationManager; mGestureState = gestureState; mTouchTimeMs = touchTimeMs; mContinuingLastGesture = continuingLastGesture; initStateCallbacks(); Loading Loading @@ -444,7 +440,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> * Note this method has no effect unless the navigation mode is NO_BUTTON. */ private void maybeUpdateRecentsAttachedState(boolean animate) { if (mMode != Mode.NO_BUTTON || mRecentsView == null) { if (!mDeviceState.isFullyGesturalNavMode() || mRecentsView == null) { return; } RemoteAnimationTargetCompat runningTaskTarget = mRecentsAnimationTargets == null Loading Loading @@ -546,7 +542,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> final boolean passed = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW; if (passed != mPassedOverviewThreshold) { mPassedOverviewThreshold = passed; if (mMode != Mode.NO_BUTTON) { if (!mDeviceState.isFullyGesturalNavMode()) { performHapticFeedback(); } } Loading Loading @@ -730,7 +726,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> if (!isFling) { if (isCancel) { endTarget = LAST_TASK; } else if (mMode == Mode.NO_BUTTON) { } else if (mDeviceState.isFullyGesturalNavMode()) { if (mIsShelfPeeking) { endTarget = RECENTS; } else if (goingToNewTask) { Loading @@ -751,9 +747,9 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> boolean willGoToNewTaskOnSwipeUp = goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity); if (mMode == Mode.NO_BUTTON && isSwipeUp && !willGoToNewTaskOnSwipeUp) { if (mDeviceState.isFullyGesturalNavMode() && isSwipeUp && !willGoToNewTaskOnSwipeUp) { endTarget = HOME; } else if (mMode == Mode.NO_BUTTON && isSwipeUp && !mIsShelfPeeking) { } else if (mDeviceState.isFullyGesturalNavMode() && isSwipeUp && !mIsShelfPeeking) { // If swiping at a diagonal, base end target on the faster velocity. endTarget = NEW_TASK; } else if (isSwipeUp) { Loading Loading @@ -793,7 +789,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> float minFlingVelocity = mContext.getResources() .getDimension(R.dimen.quickstep_fling_min_velocity); if (Math.abs(endVelocity) > minFlingVelocity && mTransitionDragLength > 0) { if (endTarget == RECENTS && mMode != Mode.NO_BUTTON) { if (endTarget == RECENTS && !mDeviceState.isFullyGesturalNavMode()) { Interpolators.OvershootParams overshoot = new Interpolators.OvershootParams( startShift, endShift, endShift, endVelocity / 1000, mTransitionDragLength, mContext); Loading Loading @@ -839,7 +835,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> } duration = Math.max(duration, mRecentsView.getScroller().getDuration()); } if (mMode == Mode.NO_BUTTON) { if (mDeviceState.isFullyGesturalNavMode()) { setShelfState(ShelfAnimState.OVERVIEW, interpolator, duration); } } else if (endTarget == NEW_TASK || endTarget == LAST_TASK) { Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java +5 −4 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import com.android.quickstep.MultiStateCallback; import com.android.quickstep.OverviewComponentObserver; import com.android.quickstep.RecentsActivity; import com.android.quickstep.RecentsAnimationController; import com.android.quickstep.RecentsAnimationDeviceState; import com.android.quickstep.RecentsModel; import com.android.quickstep.fallback.FallbackRecentsView; import com.android.quickstep.util.RectFSpringAnim; Loading Loading @@ -112,13 +113,13 @@ public class FallbackNoButtonInputConsumer extends private final PointF mEndVelocityPxPerMs = new PointF(0, 0.5f); private RunningWindowAnim mFinishAnimation; public FallbackNoButtonInputConsumer(Context context, GestureState gestureState, OverviewComponentObserver overviewComponentObserver, public FallbackNoButtonInputConsumer(Context context, RecentsAnimationDeviceState deviceState, GestureState gestureState, OverviewComponentObserver overviewComponentObserver, RunningTaskInfo runningTaskInfo, RecentsModel recentsModel, InputConsumerController inputConsumer, boolean isLikelyToStartNewTask, boolean continuingLastGesture) { super(context, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); super(context, deviceState, gestureState, overviewComponentObserver, recentsModel, inputConsumer, runningTaskInfo.id); mLauncherAlpha.value = 1; mRunningTaskInfo = runningTaskInfo; Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +1 −5 Original line number Diff line number Diff line Loading @@ -54,8 +54,6 @@ import com.android.quickstep.GestureState; import com.android.quickstep.InputConsumer; import com.android.quickstep.RecentsAnimationCallbacks; import com.android.quickstep.RecentsAnimationDeviceState; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.SysUINavigationMode.Mode; import com.android.quickstep.TaskAnimationManager; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.CachedEventDispatcher; Loading Loading @@ -85,7 +83,6 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC private final CachedEventDispatcher mRecentsViewDispatcher = new CachedEventDispatcher(); private final RunningTaskInfo mRunningTask; private final InputMonitorCompat mInputMonitorCompat; private final SysUINavigationMode.Mode mMode; private final BaseActivityInterface mActivityInterface; private final BaseSwipeUpHandler.Factory mHandlerFactory; Loading Loading @@ -137,7 +134,6 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mGestureState = gestureState; mMainThreadHandler = new Handler(Looper.getMainLooper()); mRunningTask = runningTaskInfo; mMode = SysUINavigationMode.getMode(base); mHandlerFactory = handlerFactory; mActivityInterface = mGestureState.getActivityInterface(); Loading Loading @@ -293,7 +289,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mInteractionHandler.updateDisplacement(displacement - mStartDisplacement); } if (mMode == Mode.NO_BUTTON) { if (mDeviceState.isFullyGesturalNavMode()) { mMotionPauseDetector.setDisallowPause(upDist < mMotionPauseMinDisplacement || isLikelyToStartNewTask); mMotionPauseDetector.addPosition(displacement, ev.getEventTime()); Loading