From 175b94c4aa8b7e807c16ff401cd2cf0ebf45269a Mon Sep 17 00:00:00 2001 From: Govinda Wasserman Date: Thu, 18 Apr 2019 09:54:33 -0400 Subject: [PATCH] Includes Assistant invocation type to gesture invocations This will allow logging of the way that the Assistant gets triggered as well as allowing the Assistant to modify its behavior based on how it is invoked. Test: Checked value added to bundle BUG:128982146 Change-Id: I24a276155e0564bba222859b150dc3696979d9b5 --- .../src/com/android/quickstep/AssistantTouchConsumer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/AssistantTouchConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/AssistantTouchConsumer.java index 7c0791e801..ad916be30d 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/AssistantTouchConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/AssistantTouchConsumer.java @@ -60,6 +60,9 @@ public class AssistantTouchConsumer implements InputConsumer { private static final int STATE_ASSISTANT_ACTIVE = 1; private static final int STATE_DELEGATE_ACTIVE = 2; + private static final String INVOCATION_TYPE_KEY = "invocation_type"; + private static final int INVOCATION_TYPE_GESTURE = 1; + private final PointF mDownPos = new PointF(); private final PointF mLastPos = new PointF(); private final PointF mStartDragPos = new PointF(); @@ -227,7 +230,9 @@ public class AssistantTouchConsumer implements InputConsumer { if (mDistance >= mDistThreshold && mTimeFraction >= 1) { UserEventDispatcher.newInstance(mContext).logActionOnContainer( SWIPE, mDirection, NAVBAR); - mSysUiProxy.startAssistant(new Bundle()); + Bundle args = new Bundle(); + args.putInt(INVOCATION_TYPE_KEY, INVOCATION_TYPE_GESTURE); + mSysUiProxy.startAssistant(args); mLaunchedAssistant = true; } } catch (RemoteException e) {