summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/shortcuts
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-08-10 16:06:22 -0700
committerTony Wickham <twickham@google.com>2016-08-10 18:26:41 -0700
commitbe06874c8105cf1beec8171235600da9f4ee035e (patch)
treec328c49a09e9da56de3fc14c814d598c79584beb /src/com/android/launcher3/shortcuts
parent37aba27bbcc89417588a638d61099288553387df (diff)
downloadandroid_packages_apps_Trebuchet-be06874c8105cf1beec8171235600da9f4ee035e.tar.gz
android_packages_apps_Trebuchet-be06874c8105cf1beec8171235600da9f4ee035e.tar.bz2
android_packages_apps_Trebuchet-be06874c8105cf1beec8171235600da9f4ee035e.zip
Log shortcuts open on ACTION_UP instead of in showForIcon().
- We only want to log when the container is opened and potentially used, not when a long press is followed by a drag-and-drop. - Also cleaned up code that was determining the container of the app icon, since LaunchSourceProvider.fillInLaunchSourceData() can do that instead (it's more robust and consistent). Bug: 30791570 Change-Id: I05b6750f26182fda8a9940ac66f1371c2d228ca9
Diffstat (limited to 'src/com/android/launcher3/shortcuts')
-rw-r--r--src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
index a341b973c..6cd6d33b7 100644
--- a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
+++ b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
@@ -33,7 +33,6 @@ import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.Gravity;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
@@ -54,19 +53,16 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel;
-import com.android.launcher3.LauncherSettings;
import com.android.launcher3.LauncherViewPropertyAnimator;
import com.android.launcher3.R;
import com.android.launcher3.ShortcutInfo;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.accessibility.ShortcutMenuAccessibilityDelegate;
-import com.android.launcher3.allapps.AllAppsRecyclerView;
import com.android.launcher3.compat.UserHandleCompat;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.dragndrop.DragView;
-import com.android.launcher3.folder.Folder;
import com.android.launcher3.graphics.TriangleShape;
import com.android.launcher3.logging.UserEventDispatcher;
import com.android.launcher3.userevent.nano.LauncherLogProto;
@@ -476,6 +472,7 @@ public class DeepShortcutsContainer extends LinearLayout implements View.OnLongC
}
} else if (action == MotionEvent.ACTION_UP) {
cleanupDeferredDrag(true);
+ mLauncher.getUserEventDispatcher().logDeepShortcutsOpen(mDeferredDragIcon);
} else if (action == MotionEvent.ACTION_CANCEL) {
// Do not change the source icon visibility if we are already dragging the source icon.
cleanupDeferredDrag(!mSrcIconDragStarted);
@@ -745,33 +742,11 @@ public class DeepShortcutsContainer extends LinearLayout implements View.OnLongC
container.populateAndShow(icon, ids);
icon.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
- logOpen(launcher, icon);
return container;
}
return null;
}
- private static void logOpen(Launcher launcher, View icon) {
- ItemInfo info = (ItemInfo) icon.getTag();
- long iconContainer = info.container;
- Folder openFolder = launcher.getWorkspace().getOpenFolder();
- int containerType;
- if (iconContainer == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
- containerType = LauncherLogProto.WORKSPACE;
- } else if (iconContainer == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
- containerType = LauncherLogProto.HOTSEAT;
- } else if (openFolder != null && iconContainer == openFolder.getInfo().id) {
- containerType = LauncherLogProto.FOLDER;
- } else if (icon.getParent() instanceof AllAppsRecyclerView) {
- containerType = ((AllAppsRecyclerView) icon.getParent()).getContainerType(icon);
- } else {
- // This should not happen.
- Log.w(TAG, "Couldn't determine parent of shortcut container");
- containerType = LauncherLogProto.DEFAULT_CONTAINERTYPE;
- }
- launcher.getUserEventDispatcher().logDeepShortcutsOpen(containerType);
- }
-
/**
* Extension of {@link ShortcutInfo} which does not badge the icons.
*/