summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/shortcuts
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-08-02 00:56:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-08-02 00:56:57 +0000
commit6d9b072bdda61aad6123fad214c2f1d49e12465c (patch)
treeb8332f4556026df22f4f1ec6dd932e89c3bd575a /src/com/android/launcher3/shortcuts
parentf8d2a70e0fc00559266aaab078aaefde8e34f3a7 (diff)
parent55c6691e3a2e953dc9882ad0bc0a4c1ee2d42e67 (diff)
downloadandroid_packages_apps_Trebuchet-6d9b072bdda61aad6123fad214c2f1d49e12465c.tar.gz
android_packages_apps_Trebuchet-6d9b072bdda61aad6123fad214c2f1d49e12465c.tar.bz2
android_packages_apps_Trebuchet-6d9b072bdda61aad6123fad214c2f1d49e12465c.zip
Merge "Add logging for shortcuts opening." into ub-launcher3-calgary
Diffstat (limited to 'src/com/android/launcher3/shortcuts')
-rw-r--r--src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
index 819a65332..53a28de42 100644
--- a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
+++ b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
@@ -27,13 +27,13 @@ import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.os.Build;
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;
@@ -53,6 +53,7 @@ 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.LogAccelerateInterpolator;
import com.android.launcher3.R;
@@ -60,10 +61,12 @@ 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;
@@ -734,11 +737,33 @@ 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.
*/