diff options
author | Tony <twickham@google.com> | 2019-03-13 10:12:01 -0500 |
---|---|---|
committer | Tony <twickham@google.com> | 2019-03-15 17:08:51 -0500 |
commit | d5a3df7b8362b0dd310559877b78dc642c27e014 (patch) | |
tree | e9fe0380bc2d77e17b702915e03714a0394934ee | |
parent | d082129ef816884f2658c362215c66a35704a3f3 (diff) | |
download | android_packages_apps_Trebuchet-d5a3df7b8362b0dd310559877b78dc642c27e014.tar.gz android_packages_apps_Trebuchet-d5a3df7b8362b0dd310559877b78dc642c27e014.tar.bz2 android_packages_apps_Trebuchet-d5a3df7b8362b0dd310559877b78dc642c27e014.zip |
Don't close popup container if touch came from nav bar
Moved EDGE_NAV_BAR from quickstep package to launcher3
Bug: 127917144
Change-Id: Ic619ea49896ca8e49a9a539b7dc7d682291241b7
7 files changed, 14 insertions, 7 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java index 4e010d25e..84097a185 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java @@ -24,7 +24,7 @@ import static android.view.MotionEvent.INVALID_POINTER_ID; import static com.android.launcher3.util.RaceConditionTracker.ENTER; import static com.android.launcher3.util.RaceConditionTracker.EXIT; -import static com.android.quickstep.TouchInteractionService.EDGE_NAV_BAR; +import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.quickstep.TouchInteractionService.TOUCH_INTERACTION_LOG; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/OverviewInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/OverviewInputConsumer.java index cce5cb3f0..02ffdb3e1 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/OverviewInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/OverviewInputConsumer.java @@ -30,6 +30,7 @@ import android.view.MotionEvent; import android.view.ViewConfiguration; import com.android.launcher3.BaseDraggingActivity; +import com.android.launcher3.Utilities; import com.android.launcher3.views.BaseDragLayer; import com.android.quickstep.util.CachedEventDispatcher; import com.android.systemui.shared.system.ActivityManagerWrapper; @@ -139,7 +140,7 @@ public class OverviewInputConsumer<T extends BaseDraggingActivity> return; } int flags = ev.getEdgeFlags(); - ev.setEdgeFlags(flags | TouchInteractionService.EDGE_NAV_BAR); + ev.setEdgeFlags(flags | Utilities.EDGE_NAV_BAR); ev.offsetLocation(-mLocationOnScreen[0], -mLocationOnScreen[1]); if (ev.getAction() == ACTION_DOWN) { mTarget.onInterceptTouchEvent(ev); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index 6d608eef6..c281d2c1c 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -74,8 +74,6 @@ public class TouchInteractionService extends Service { public static final EventLogArray TOUCH_INTERACTION_LOG = new EventLogArray("touch_interaction_log", 40); - public static final int EDGE_NAV_BAR = 1 << 8; - private static final String TAG = "TouchInteractionService"; private final IBinder mMyBinder = new IOverviewProxy.Stub() { diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index b7a708ff6..37febf9a0 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -27,7 +27,7 @@ import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS; import static com.android.launcher3.uioverrides.TaskViewTouchController.SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW; import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId; -import static com.android.quickstep.TouchInteractionService.EDGE_NAV_BAR; +import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.quickstep.util.ClipAnimationHelper.TransformParams; import android.animation.Animator; diff --git a/quickstep/src/com/android/launcher3/uioverrides/LandscapeEdgeSwipeController.java b/quickstep/src/com/android/launcher3/uioverrides/LandscapeEdgeSwipeController.java index fd4bf9b8f..086cbdbfa 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/LandscapeEdgeSwipeController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/LandscapeEdgeSwipeController.java @@ -2,7 +2,7 @@ package com.android.launcher3.uioverrides; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; -import static com.android.quickstep.TouchInteractionService.EDGE_NAV_BAR; +import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import android.view.MotionEvent; diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 703663915..dd755cb97 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -54,6 +54,7 @@ import android.util.DisplayMetrics; import android.util.Log; import android.util.Pair; import android.util.TypedValue; +import android.view.MotionEvent; import android.view.View; import android.view.animation.Interpolator; @@ -115,6 +116,11 @@ public final class Utilities { public static final int SINGLE_FRAME_MS = 16; /** + * Set on a motion event dispatched from the nav bar. See {@link MotionEvent#setEdgeFlags(int)}. + */ + public static final int EDGE_NAV_BAR = 1 << 8; + + /** * Indicates if the device has a debug build. Should only be used to store additional info or * add extra logging and not for changing the app behavior. */ diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index b0af4c678..10ecc4f04 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -22,6 +22,7 @@ import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS_IF_NOTIFI import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import static com.android.launcher3.userevent.nano.LauncherLogProto.ItemType; import static com.android.launcher3.userevent.nano.LauncherLogProto.Target; +import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import android.animation.AnimatorSet; import android.animation.LayoutTransition; @@ -167,7 +168,8 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource, public boolean onControllerInterceptTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { BaseDragLayer dl = getPopupContainer(); - if (!dl.isEventOverView(this, ev)) { + final boolean cameFromNavBar = (ev.getEdgeFlags() & EDGE_NAV_BAR) != 0; + if (!cameFromNavBar && !dl.isEventOverView(this, ev)) { mLauncher.getUserEventDispatcher().logActionTapOutside( LoggerUtils.newContainerTarget(ContainerType.DEEPSHORTCUTS)); close(true); |