diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-07-25 21:55:16 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-07-25 21:55:16 +0000 |
commit | 2cccb134a48b7e6277692c3d1a20d1fa507fe7c4 (patch) | |
tree | 9257efc9000d8cb1a1edf7afc40c5563d72a0f53 /src/com | |
parent | a86451129381181be37fb5b39b3da96376345815 (diff) | |
parent | e299a4594483d77544e00ee7a58b51ec70f45c13 (diff) | |
download | android_packages_apps_Trebuchet-2cccb134a48b7e6277692c3d1a20d1fa507fe7c4.tar.gz android_packages_apps_Trebuchet-2cccb134a48b7e6277692c3d1a20d1fa507fe7c4.tar.bz2 android_packages_apps_Trebuchet-2cccb134a48b7e6277692c3d1a20d1fa507fe7c4.zip |
Merge "Add several missing swipe logging Enable swipe down to open noti shade from landscape" into ub-launcher3-qt-r1-dev
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 7 | ||||
-rw-r--r-- | src/com/android/launcher3/logging/StatsLogUtils.java | 19 | ||||
-rw-r--r-- | src/com/android/launcher3/logging/UserEventDispatcher.java | 13 |
3 files changed, 37 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 8cd082299..269a59111 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -81,10 +81,10 @@ import com.android.launcher3.folder.PreviewBackground; import com.android.launcher3.graphics.DragPreviewProvider; import com.android.launcher3.graphics.PreloadIconDrawable; import com.android.launcher3.graphics.RotationMode; +import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.pageindicators.WorkspacePageIndicator; import com.android.launcher3.popup.PopupContainerWithArrow; import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider; -import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.WorkspaceTouchListener; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; @@ -1053,8 +1053,11 @@ public class Workspace extends PagedView<WorkspacePageIndicator> // Not announcing the overlay page for accessibility since it announces itself. } else if (Float.compare(scroll, 0f) == 0) { if (mOverlayShown) { - mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE, + UserEventDispatcher ued = mLauncher.getUserEventDispatcher(); + if (!ued.isPreviousHomeGesture()) { + mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE, Action.Direction.RIGHT, ContainerType.WORKSPACE, -1); + } } else if (Float.compare(mOverlayTranslation, 0f) != 0) { // When arriving to 0 overscroll from non-zero overscroll, announce page for // accessibility since default announcements were disabled while in overscroll diff --git a/src/com/android/launcher3/logging/StatsLogUtils.java b/src/com/android/launcher3/logging/StatsLogUtils.java index 647f255af..b02a0504f 100644 --- a/src/com/android/launcher3/logging/StatsLogUtils.java +++ b/src/com/android/launcher3/logging/StatsLogUtils.java @@ -1,9 +1,12 @@ package com.android.launcher3.logging; +import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType.DEFAULT_CONTAINERTYPE; + import android.view.View; import android.view.ViewParent; import com.android.launcher3.ItemInfo; +import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import com.android.launcher3.userevent.nano.LauncherLogProto.Target; import androidx.annotation.Nullable; @@ -64,4 +67,20 @@ public class StatsLogUtils { } return null; } + + public static int getContainerTypeFromState(int state) { + int containerType = DEFAULT_CONTAINERTYPE; + switch (state) { + case StatsLogUtils.LAUNCHER_STATE_ALLAPPS: + containerType = ContainerType.ALLAPPS; + break; + case StatsLogUtils.LAUNCHER_STATE_HOME: + containerType = ContainerType.WORKSPACE; + break; + case StatsLogUtils.LAUNCHER_STATE_OVERVIEW: + containerType = ContainerType.OVERVIEW; + break; + } + return containerType; + } } diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index bd785a107..d81020ef3 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -115,6 +115,7 @@ public class UserEventDispatcher implements ResourceBasedOverride { protected InstantAppResolver mInstantAppResolver; private boolean mAppOrTaskLaunch; private UserEventDelegate mDelegate; + private boolean mPreviousHomeGesture; // APP_ICON SHORTCUT WIDGET // -------------------------------------------------------------- @@ -399,11 +400,22 @@ public class UserEventDispatcher implements ResourceBasedOverride { mElapsedContainerMillis = SystemClock.uptimeMillis(); } + public final void setPreviousHomeGesture(boolean homeGesture) { + mPreviousHomeGesture = homeGesture; + } + + public final boolean isPreviousHomeGesture() { + return mPreviousHomeGesture; + } + public final void resetActionDurationMillis() { mActionDurationMillis = SystemClock.uptimeMillis(); } public void dispatchUserEvent(LauncherEvent ev, Intent intent) { + if (mPreviousHomeGesture) { + mPreviousHomeGesture = false; + } mAppOrTaskLaunch = false; ev.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; ev.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; @@ -426,6 +438,7 @@ public class UserEventDispatcher implements ResourceBasedOverride { ev.actionDurationMillis); log += "\n\n"; Log.d(TAG, log); + return; } private static String getTargetsStr(Target[] targets) { |