Loading quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +15 −9 Original line number Diff line number Diff line Loading @@ -481,14 +481,14 @@ public class TouchInteractionService extends Service implements PluginListener<O } ActiveGestureLog.INSTANCE.addLog("onMotionEvent", event.getActionMasked()); boolean cleanUpConsumer = (action == ACTION_UP || action == ACTION_CANCEL) && mConsumer != null && !mConsumer.getActiveConsumerInHierarchy().isConsumerDetachedFromGesture(); mUncheckedConsumer.onMotionEvent(event); if (action == ACTION_UP || action == ACTION_CANCEL) { if (mConsumer != null && !mConsumer.isConsumerDetachedFromGesture()) { onConsumerInactive(mConsumer); if (cleanUpConsumer) { reset(); } } TraceHelper.INSTANCE.endFlagsOverride(traceToken); } Loading Loading @@ -686,14 +686,20 @@ public class TouchInteractionService extends Service implements PluginListener<O } /** * To be called by the consumer when it's no longer active. * To be called by the consumer when it's no longer active. This can be called by any consumer * in the hierarchy at any point during the gesture (ie. if a delegate consumer starts * intercepting touches, the base consumer can try to call this). */ private void onConsumerInactive(InputConsumer caller) { if (mConsumer != null && mConsumer.isInConsumerHierarchy(caller)) { if (mConsumer != null && mConsumer.getActiveConsumerInHierarchy() == caller) { reset(); } } private void reset() { mConsumer = mUncheckedConsumer = mResetGestureInputConsumer; mGestureState = new GestureState(); } } private void preloadOverview(boolean fromInit) { if (!mDeviceState.isUserUnlocked()) { Loading quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java +5 −7 Original line number Diff line number Diff line Loading @@ -25,13 +25,11 @@ public abstract class DelegateInputConsumer implements InputConsumer { } @Override public boolean isConsumerDetachedFromGesture() { return mDelegate.isConsumerDetachedFromGesture(); public InputConsumer getActiveConsumerInHierarchy() { if (mState == STATE_ACTIVE) { return this; } @Override public boolean isInConsumerHierarchy(InputConsumer candidate) { return this == candidate || mDelegate.isInConsumerHierarchy(candidate); return mDelegate.getActiveConsumerInHierarchy(); } @Override Loading quickstep/src/com/android/quickstep/InputConsumer.java +3 −3 Original line number Diff line number Diff line Loading @@ -70,10 +70,10 @@ public interface InputConsumer { } /** * Returns true if the given input consumer is in the hierarchy of this input consumer. * Returns the active input consumer is in the hierarchy of this input consumer. */ default boolean isInConsumerHierarchy(InputConsumer candidate) { return this == candidate; default InputConsumer getActiveConsumerInHierarchy() { return this; } /** Loading Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +15 −9 Original line number Diff line number Diff line Loading @@ -481,14 +481,14 @@ public class TouchInteractionService extends Service implements PluginListener<O } ActiveGestureLog.INSTANCE.addLog("onMotionEvent", event.getActionMasked()); boolean cleanUpConsumer = (action == ACTION_UP || action == ACTION_CANCEL) && mConsumer != null && !mConsumer.getActiveConsumerInHierarchy().isConsumerDetachedFromGesture(); mUncheckedConsumer.onMotionEvent(event); if (action == ACTION_UP || action == ACTION_CANCEL) { if (mConsumer != null && !mConsumer.isConsumerDetachedFromGesture()) { onConsumerInactive(mConsumer); if (cleanUpConsumer) { reset(); } } TraceHelper.INSTANCE.endFlagsOverride(traceToken); } Loading Loading @@ -686,14 +686,20 @@ public class TouchInteractionService extends Service implements PluginListener<O } /** * To be called by the consumer when it's no longer active. * To be called by the consumer when it's no longer active. This can be called by any consumer * in the hierarchy at any point during the gesture (ie. if a delegate consumer starts * intercepting touches, the base consumer can try to call this). */ private void onConsumerInactive(InputConsumer caller) { if (mConsumer != null && mConsumer.isInConsumerHierarchy(caller)) { if (mConsumer != null && mConsumer.getActiveConsumerInHierarchy() == caller) { reset(); } } private void reset() { mConsumer = mUncheckedConsumer = mResetGestureInputConsumer; mGestureState = new GestureState(); } } private void preloadOverview(boolean fromInit) { if (!mDeviceState.isUserUnlocked()) { Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java +5 −7 Original line number Diff line number Diff line Loading @@ -25,13 +25,11 @@ public abstract class DelegateInputConsumer implements InputConsumer { } @Override public boolean isConsumerDetachedFromGesture() { return mDelegate.isConsumerDetachedFromGesture(); public InputConsumer getActiveConsumerInHierarchy() { if (mState == STATE_ACTIVE) { return this; } @Override public boolean isInConsumerHierarchy(InputConsumer candidate) { return this == candidate || mDelegate.isInConsumerHierarchy(candidate); return mDelegate.getActiveConsumerInHierarchy(); } @Override Loading
quickstep/src/com/android/quickstep/InputConsumer.java +3 −3 Original line number Diff line number Diff line Loading @@ -70,10 +70,10 @@ public interface InputConsumer { } /** * Returns true if the given input consumer is in the hierarchy of this input consumer. * Returns the active input consumer is in the hierarchy of this input consumer. */ default boolean isInConsumerHierarchy(InputConsumer candidate) { return this == candidate; default InputConsumer getActiveConsumerInHierarchy() { return this; } /** Loading