Adding context for app launches.

Bug: 21492784
Change-Id: I1b28ac8f44498e1d9770e770b074f19c721c3f10
This commit is contained in:
Winson Chung
2015-05-28 17:33:40 -07:00
parent 316490e636
commit 8f1eff7b6c
10 changed files with 147 additions and 26 deletions

View File

@@ -26,6 +26,7 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.InsetDrawable;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
@@ -57,6 +58,7 @@ import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherTransitionable;
import com.android.launcher3.R;
import com.android.launcher3.Stats;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.allapps.AppSearchManager.AppSearchResultCallback;
@@ -172,7 +174,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
TextWatcher, TextView.OnEditorActionListener, LauncherTransitionable,
AlphabeticalAppsList.AdapterChangedCallback, AllAppsGridAdapter.PredictionBarSpacerCallbacks,
View.OnTouchListener, View.OnClickListener, View.OnLongClickListener,
ViewTreeObserver.OnPreDrawListener, AppSearchResultCallback {
ViewTreeObserver.OnPreDrawListener, AppSearchResultCallback, Stats.LaunchSourceProvider {
public static final boolean GRID_MERGE_SECTIONS = true;
@@ -870,6 +872,15 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
return false;
}
@Override
public void fillInLaunchSourceData(Bundle sourceData) {
// Since the other cases are caught by the AllAppsRecyclerView LaunchSourceProvider, we just
// handle the prediction bar icons here
sourceData.putString(Stats.SOURCE_EXTRA_CONTAINER, Stats.CONTAINER_ALL_APPS);
sourceData.putString(Stats.SOURCE_EXTRA_SUB_CONTAINER,
Stats.SUB_CONTAINER_ALL_APPS_PREDICTION);
}
/**
* Returns the predicted app in the prediction bar given a set of local coordinates.
*/