diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2016-04-12 18:32:04 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2016-04-13 10:58:33 -0700 |
commit | ddec1c739ef37c3a042982b8943fe42e04b65f4c (patch) | |
tree | 565933d46552049c8af29e8615964e47919fd81c /src/com/android/launcher3/allapps/AllAppsRecyclerView.java | |
parent | 30a716157b748258e5461fe783298ba7c740835f (diff) | |
download | android_packages_apps_Trebuchet-ddec1c739ef37c3a042982b8943fe42e04b65f4c.tar.gz android_packages_apps_Trebuchet-ddec1c739ef37c3a042982b8943fe42e04b65f4c.tar.bz2 android_packages_apps_Trebuchet-ddec1c739ef37c3a042982b8943fe42e04b65f4c.zip |
Refactor UserEventLogging, Add predictedRank, replace Bundle with Proto
b/26494415
- Removed bundle object that became redundant now that we have LauncherEvent proto
- Combined Stats and UserEventLogger as they are effectively doing same thing
- Removed parent field inside Target
- added predictedRank target inside Target
b/27967359
- make com.android.launcher3.action.LAUNCH broadcast explicit
Later CL: finish packageName/intent/componentHash/predictedRank fields
Change-Id: I441fb46c834f73e58a4d2324e8da7971e8713ec8
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsRecyclerView.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsRecyclerView.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java index 2b3d061e6..32d444d8f 100644 --- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java +++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java @@ -19,7 +19,6 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.drawable.Drawable; -import android.os.Bundle; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.view.View; @@ -27,17 +26,19 @@ import android.view.View; import com.android.launcher3.BaseRecyclerView; import com.android.launcher3.BubbleTextView; import com.android.launcher3.DeviceProfile; +import com.android.launcher3.ItemInfo; import com.android.launcher3.R; -import com.android.launcher3.Stats; import com.android.launcher3.Utilities; - +import com.android.launcher3.logging.UserEventLogger.LaunchSourceProvider; +import com.android.launcher3.userevent.nano.LauncherLogProto; +import com.android.launcher3.userevent.nano.LauncherLogProto.Target; import java.util.List; /** * A RecyclerView with custom fast scroll support for the all apps view. */ public class AllAppsRecyclerView extends BaseRecyclerView - implements Stats.LaunchSourceProvider { + implements LaunchSourceProvider { private AlphabeticalAppsList mApps; private AllAppsFastScrollHelper mFastScrollHelper; @@ -165,11 +166,9 @@ public class AllAppsRecyclerView extends BaseRecyclerView } @Override - public void fillInLaunchSourceData(View v, Bundle sourceData) { - sourceData.putString(Stats.SOURCE_EXTRA_CONTAINER, Stats.CONTAINER_ALL_APPS); + public void fillInLaunchSourceData(View v, ItemInfo info, Target target, Target targetParent) { if (mApps.hasFilter()) { - sourceData.putString(Stats.SOURCE_EXTRA_SUB_CONTAINER, - Stats.SUB_CONTAINER_ALL_APPS_SEARCH); + targetParent.containerType = LauncherLogProto.SEARCHRESULT; } else { if (v instanceof BubbleTextView) { BubbleTextView icon = (BubbleTextView) v; @@ -178,14 +177,13 @@ public class AllAppsRecyclerView extends BaseRecyclerView List<AlphabeticalAppsList.AdapterItem> items = mApps.getAdapterItems(); AlphabeticalAppsList.AdapterItem item = items.get(position); if (item.viewType == AllAppsGridAdapter.PREDICTION_ICON_VIEW_TYPE) { - sourceData.putString(Stats.SOURCE_EXTRA_SUB_CONTAINER, - Stats.SUB_CONTAINER_ALL_APPS_PREDICTION); + targetParent.containerType = LauncherLogProto.PREDICTION; return; } } } - sourceData.putString(Stats.SOURCE_EXTRA_SUB_CONTAINER, - Stats.SUB_CONTAINER_ALL_APPS_A_Z); + + targetParent.containerType = LauncherLogProto.ALLAPPS; } } |