Migrate from Plugin SearchTarget to API search Target [2/3]
- Adds support for android.app.search.SearchTarget in plugin while maintaining plugin SearchTarget support - Introduces SEARCH_TARGET_LEGACY temporary to switch between plugin and sdk variants. - Maps resultType and layoutType pairs to the appropriate view Bug: 177223401 Test: Manual Change-Id: If8d4bb7c21c47a12447dcb0c56eed8781bd21e54
This commit is contained in:
parent
992ab43390
commit
a60d1f9be7
|
@ -18,15 +18,18 @@ package com.android.launcher3.search;
|
||||||
|
|
||||||
import static com.android.launcher3.allapps.AllAppsGridAdapter.VIEW_TYPE_ICON;
|
import static com.android.launcher3.allapps.AllAppsGridAdapter.VIEW_TYPE_ICON;
|
||||||
|
|
||||||
|
import android.app.search.SearchTarget;
|
||||||
import android.util.SparseIntArray;
|
import android.util.SparseIntArray;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.android.launcher3.Launcher;
|
import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
|
import com.android.launcher3.allapps.AllAppsContainerView;
|
||||||
import com.android.launcher3.allapps.AllAppsGridAdapter;
|
import com.android.launcher3.allapps.AllAppsGridAdapter;
|
||||||
import com.android.launcher3.allapps.search.SearchAdapterProvider;
|
import com.android.launcher3.allapps.search.SearchAdapterProvider;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.launcher3.config.FeatureFlags;
|
||||||
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides views for on-device search results
|
* Provides views for on-device search results
|
||||||
|
@ -45,11 +48,13 @@ public class DeviceSearchAdapterProvider extends SearchAdapterProvider {
|
||||||
public static final int VIEW_TYPE_SEARCH_WIDGET_LIVE = 1 << 15;
|
public static final int VIEW_TYPE_SEARCH_WIDGET_LIVE = 1 << 15;
|
||||||
public static final int VIEW_TYPE_SEARCH_WIDGET_PREVIEW = 1 << 16;
|
public static final int VIEW_TYPE_SEARCH_WIDGET_PREVIEW = 1 << 16;
|
||||||
|
|
||||||
|
private final AllAppsContainerView mAppsView;
|
||||||
|
|
||||||
private final SparseIntArray mViewTypeToLayoutMap = new SparseIntArray();
|
private final SparseIntArray mViewTypeToLayoutMap = new SparseIntArray();
|
||||||
|
|
||||||
public DeviceSearchAdapterProvider(Launcher launcher) {
|
public DeviceSearchAdapterProvider(Launcher launcher, AllAppsContainerView appsView) {
|
||||||
super(launcher);
|
super(launcher);
|
||||||
|
mAppsView = appsView;
|
||||||
|
|
||||||
mViewTypeToLayoutMap.put(VIEW_TYPE_SEARCH_ICON, R.layout.search_result_icon);
|
mViewTypeToLayoutMap.put(VIEW_TYPE_SEARCH_ICON, R.layout.search_result_icon);
|
||||||
mViewTypeToLayoutMap.put(VIEW_TYPE_SEARCH_CORPUS_TITLE, R.layout.search_section_title);
|
mViewTypeToLayoutMap.put(VIEW_TYPE_SEARCH_CORPUS_TITLE, R.layout.search_section_title);
|
||||||
|
@ -68,12 +73,16 @@ public class DeviceSearchAdapterProvider extends SearchAdapterProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindView(AllAppsGridAdapter.ViewHolder holder, int position) {
|
public void onBindView(AllAppsGridAdapter.ViewHolder holder, int position) {
|
||||||
SearchAdapterItem item = (SearchAdapterItem) Launcher.getLauncher(mLauncher)
|
SearchAdapterItem item = (SearchAdapterItem) mAppsView.getApps().getAdapterItems().get(
|
||||||
.getAppsView().getApps().getAdapterItems().get(position);
|
position);
|
||||||
SearchTargetHandler
|
SearchTargetHandler
|
||||||
payloadResultView =
|
payloadResultView =
|
||||||
(SearchTargetHandler) holder.itemView;
|
(SearchTargetHandler) holder.itemView;
|
||||||
payloadResultView.applySearchTarget(item.getSearchTarget());
|
if (FeatureFlags.SEARCH_TARGET_LEGACY.get()) {
|
||||||
|
payloadResultView.applySearchTarget(item.getSearchTargetLegacy());
|
||||||
|
} else {
|
||||||
|
payloadResultView.applySearchTarget(item.getSearchTarget());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -101,10 +110,23 @@ public class DeviceSearchAdapterProvider extends SearchAdapterProvider {
|
||||||
@Override
|
@Override
|
||||||
public boolean onAdapterItemSelected(AllAppsGridAdapter.AdapterItem focusedItem) {
|
public boolean onAdapterItemSelected(AllAppsGridAdapter.AdapterItem focusedItem) {
|
||||||
if (focusedItem instanceof SearchTargetHandler) {
|
if (focusedItem instanceof SearchTargetHandler) {
|
||||||
SearchTarget searchTarget = ((SearchAdapterItem) focusedItem).getSearchTarget();
|
SearchTargetLegacy searchTarget = ((SearchAdapterItem) focusedItem)
|
||||||
|
.getSearchTargetLegacy();
|
||||||
SearchEventTracker.INSTANCE.get(mLauncher).quickSelect(searchTarget);
|
SearchEventTracker.INSTANCE.get(mLauncher).quickSelect(searchTarget);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines what view type should be used to present search target.
|
||||||
|
* Returns -1 if viewType is not found
|
||||||
|
*/
|
||||||
|
public int getViewTypeForSearchTarget(SearchTarget t) {
|
||||||
|
//TODO: Replace with values from :SearchUi
|
||||||
|
if (t.getResultType() == 1 && t.getLayoutType().equals("icon")) {
|
||||||
|
return VIEW_TYPE_SEARCH_ICON;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,13 +27,16 @@ import static com.android.launcher3.search.DeviceSearchAdapterProvider.VIEW_TYPE
|
||||||
import static com.android.launcher3.search.DeviceSearchAdapterProvider.VIEW_TYPE_SEARCH_WIDGET_LIVE;
|
import static com.android.launcher3.search.DeviceSearchAdapterProvider.VIEW_TYPE_SEARCH_WIDGET_LIVE;
|
||||||
import static com.android.launcher3.search.DeviceSearchAdapterProvider.VIEW_TYPE_SEARCH_WIDGET_PREVIEW;
|
import static com.android.launcher3.search.DeviceSearchAdapterProvider.VIEW_TYPE_SEARCH_WIDGET_PREVIEW;
|
||||||
|
|
||||||
|
import android.app.search.SearchTarget;
|
||||||
|
|
||||||
import com.android.launcher3.allapps.AllAppsGridAdapter;
|
import com.android.launcher3.allapps.AllAppsGridAdapter;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of AdapterItem that contains an extra payload specific to item
|
* Extension of AdapterItem that contains an extra payload specific to item
|
||||||
*/
|
*/
|
||||||
public class SearchAdapterItem extends AllAppsGridAdapter.AdapterItem {
|
public class SearchAdapterItem extends AllAppsGridAdapter.AdapterItem {
|
||||||
|
private SearchTargetLegacy mSearchTargetLegacy;
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTarget mSearchTarget;
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,11 +46,21 @@ public class SearchAdapterItem extends AllAppsGridAdapter.AdapterItem {
|
||||||
| VIEW_TYPE_SEARCH_WIDGET_PREVIEW | VIEW_TYPE_SEARCH_WIDGET_LIVE
|
| VIEW_TYPE_SEARCH_WIDGET_PREVIEW | VIEW_TYPE_SEARCH_WIDGET_LIVE
|
||||||
| VIEW_TYPE_SEARCH_SUGGEST;
|
| VIEW_TYPE_SEARCH_SUGGEST;
|
||||||
|
|
||||||
|
public SearchAdapterItem(SearchTargetLegacy searchTargetLegacy, int type) {
|
||||||
|
mSearchTargetLegacy = searchTargetLegacy;
|
||||||
|
viewType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public SearchAdapterItem(SearchTarget searchTarget, int type) {
|
public SearchAdapterItem(SearchTarget searchTarget, int type) {
|
||||||
mSearchTarget = searchTarget;
|
mSearchTarget = searchTarget;
|
||||||
viewType = type;
|
viewType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SearchTargetLegacy getSearchTargetLegacy() {
|
||||||
|
return mSearchTargetLegacy;
|
||||||
|
}
|
||||||
|
|
||||||
public SearchTarget getSearchTarget() {
|
public SearchTarget getSearchTarget() {
|
||||||
return mSearchTarget;
|
return mSearchTarget;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,8 @@ import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.android.launcher3.util.MainThreadInitializedObject;
|
import com.android.launcher3.util.MainThreadInitializedObject;
|
||||||
import com.android.systemui.plugins.AllAppsSearchPlugin;
|
import com.android.systemui.plugins.AllAppsSearchPlugin;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import java.util.WeakHashMap;
|
||||||
public class SearchEventTracker {
|
public class SearchEventTracker {
|
||||||
@Nullable
|
@Nullable
|
||||||
private AllAppsSearchPlugin mPlugin;
|
private AllAppsSearchPlugin mPlugin;
|
||||||
private final WeakHashMap<SearchTarget, SearchTargetHandler>
|
private final WeakHashMap<SearchTargetLegacy, SearchTargetHandler>
|
||||||
mCallbacks = new WeakHashMap<>();
|
mCallbacks = new WeakHashMap<>();
|
||||||
|
|
||||||
public static final MainThreadInitializedObject<SearchEventTracker> INSTANCE =
|
public static final MainThreadInitializedObject<SearchEventTracker> INSTANCE =
|
||||||
|
@ -60,26 +60,27 @@ public class SearchEventTracker {
|
||||||
/**
|
/**
|
||||||
* Sends SearchTargetEvent to search provider
|
* Sends SearchTargetEvent to search provider
|
||||||
*/
|
*/
|
||||||
public void notifySearchTargetEvent(SearchTargetEvent searchTargetEvent) {
|
public void notifySearchTargetEvent(SearchTargetEventLegacy searchTargetEvent) {
|
||||||
if (mPlugin != null) {
|
if (mPlugin != null) {
|
||||||
UI_HELPER_EXECUTOR.post(() -> mPlugin.notifySearchTargetEvent(searchTargetEvent));
|
UI_HELPER_EXECUTOR.post(() -> mPlugin.notifySearchTargetEventLegacy(searchTargetEvent));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a {@link SearchTargetHandler} to handle quick launch for specified SearchTarget.
|
* Registers a {@link SearchTargetHandler} to handle quick launch for specified SearchTarget.
|
||||||
*/
|
*/
|
||||||
public void registerWeakHandler(SearchTarget searchTarget, SearchTargetHandler targetHandler) {
|
public void registerWeakHandler(SearchTargetLegacy searchTarget,
|
||||||
|
SearchTargetHandler targetHandler) {
|
||||||
mCallbacks.put(searchTarget, targetHandler);
|
mCallbacks.put(searchTarget, targetHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles quick select for SearchTarget
|
* Handles quick select for SearchTarget
|
||||||
*/
|
*/
|
||||||
public void quickSelect(SearchTarget searchTarget) {
|
public void quickSelect(SearchTargetLegacy searchTarget) {
|
||||||
SearchTargetHandler searchTargetHandler = mCallbacks.get(searchTarget);
|
SearchTargetHandler searchTargetHandler = mCallbacks.get(searchTarget);
|
||||||
if (searchTargetHandler != null) {
|
if (searchTargetHandler != null) {
|
||||||
searchTargetHandler.handleSelection(SearchTargetEvent.QUICK_SELECT);
|
searchTargetHandler.handleSelection(SearchTargetEventLegacy.QUICK_SELECT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
|
||||||
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
|
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
|
||||||
|
|
||||||
import android.app.RemoteAction;
|
import android.app.RemoteAction;
|
||||||
|
import android.app.search.SearchTarget;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.ShortcutInfo;
|
import android.content.pm.ShortcutInfo;
|
||||||
|
@ -42,8 +43,8 @@ import com.android.launcher3.model.data.RemoteActionItemInfo;
|
||||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||||
import com.android.launcher3.touch.ItemLongClickListener;
|
import com.android.launcher3.touch.ItemLongClickListener;
|
||||||
import com.android.launcher3.util.ComponentKey;
|
import com.android.launcher3.util.ComponentKey;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
@ -69,7 +70,7 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
|
|
||||||
private final Launcher mLauncher;
|
private final Launcher mLauncher;
|
||||||
|
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTargetLegacy mSearchTarget;
|
||||||
private Consumer<ItemInfoWithIcon> mOnItemInfoChanged;
|
private Consumer<ItemInfoWithIcon> mOnItemInfoChanged;
|
||||||
|
|
||||||
public SearchResultIcon(Context context) {
|
public SearchResultIcon(Context context) {
|
||||||
|
@ -100,13 +101,13 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
* Applies search target with a ItemInfoWithIcon consumer to be called after itemInfo is
|
* Applies search target with a ItemInfoWithIcon consumer to be called after itemInfo is
|
||||||
* constructed
|
* constructed
|
||||||
*/
|
*/
|
||||||
public void applySearchTarget(SearchTarget searchTarget, Consumer<ItemInfoWithIcon> cb) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget, Consumer<ItemInfoWithIcon> cb) {
|
||||||
mOnItemInfoChanged = cb;
|
mOnItemInfoChanged = cb;
|
||||||
applySearchTarget(searchTarget);
|
applySearchTarget(searchTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget searchTarget) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||||
mSearchTarget = searchTarget;
|
mSearchTarget = searchTarget;
|
||||||
SearchEventTracker.getInstance(getContext()).registerWeakHandler(mSearchTarget, this);
|
SearchEventTracker.getInstance(getContext()).registerWeakHandler(mSearchTarget, this);
|
||||||
setVisibility(VISIBLE);
|
setVisibility(VISIBLE);
|
||||||
|
@ -127,9 +128,16 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void applySearchTarget(SearchTarget searchTarget) {
|
||||||
|
prepareUsingApp(new ComponentName(searchTarget.getPackageName(),
|
||||||
|
searchTarget.getExtras().getString("class")), searchTarget.getUserHandle());
|
||||||
|
}
|
||||||
|
|
||||||
private void prepareUsingApp(ComponentName componentName, UserHandle userHandle) {
|
private void prepareUsingApp(ComponentName componentName, UserHandle userHandle) {
|
||||||
AllAppsStore appsStore = mLauncher.getAppsView().getAppsStore();
|
AllAppsStore appsStore = mLauncher.getAppsView().getAppsStore();
|
||||||
AppInfo appInfo = appsStore.getApp(new ComponentKey(componentName, userHandle));
|
AppInfo appInfo = appsStore.getApp(new ComponentKey(componentName, userHandle));
|
||||||
|
|
||||||
if (appInfo == null) {
|
if (appInfo == null) {
|
||||||
setVisibility(GONE);
|
setVisibility(GONE);
|
||||||
return;
|
return;
|
||||||
|
@ -181,7 +189,8 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reportEvent(int eventType) {
|
private void reportEvent(int eventType) {
|
||||||
SearchTargetEvent.Builder b = new SearchTargetEvent.Builder(mSearchTarget, eventType);
|
SearchTargetEventLegacy.Builder b = new SearchTargetEventLegacy.Builder(mSearchTarget,
|
||||||
|
eventType);
|
||||||
if (mSearchTarget.getItemType().equals(TARGET_TYPE_SHORTCUT)) {
|
if (mSearchTarget.getItemType().equals(TARGET_TYPE_SHORTCUT)) {
|
||||||
b.setShortcutPosition(0);
|
b.setShortcutPosition(0);
|
||||||
}
|
}
|
||||||
|
@ -191,7 +200,7 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
handleSelection(SearchTargetEvent.SELECT);
|
handleSelection(SearchTargetEventLegacy.SELECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -199,7 +208,7 @@ public class SearchResultIcon extends BubbleTextView implements
|
||||||
if (!supportsLongPress(mSearchTarget.getItemType())) {
|
if (!supportsLongPress(mSearchTarget.getItemType())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
reportEvent(SearchTargetEvent.LONG_PRESS);
|
reportEvent(SearchTargetEventLegacy.LONG_PRESS);
|
||||||
return ItemLongClickListener.INSTANCE_ALL_APPS.onLongClick(view);
|
return ItemLongClickListener.INSTANCE_ALL_APPS.onLongClick(view);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,8 @@ import com.android.launcher3.R;
|
||||||
import com.android.launcher3.model.data.ItemInfoWithIcon;
|
import com.android.launcher3.model.data.ItemInfoWithIcon;
|
||||||
import com.android.launcher3.model.data.PackageItemInfo;
|
import com.android.launcher3.model.data.PackageItemInfo;
|
||||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -63,7 +63,7 @@ public class SearchResultIconRow extends LinearLayout implements
|
||||||
private TextView mDescriptionView;
|
private TextView mDescriptionView;
|
||||||
private BubbleTextView[] mShortcutViews = new BubbleTextView[2];
|
private BubbleTextView[] mShortcutViews = new BubbleTextView[2];
|
||||||
|
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTargetLegacy mSearchTarget;
|
||||||
private PackageItemInfo mProviderInfo;
|
private PackageItemInfo mProviderInfo;
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,8 +100,9 @@ public class SearchResultIconRow extends LinearLayout implements
|
||||||
lp.width = iconSize;
|
lp.width = iconSize;
|
||||||
bubbleTextView.setOnClickListener(view -> {
|
bubbleTextView.setOnClickListener(view -> {
|
||||||
WorkspaceItemInfo itemInfo = (WorkspaceItemInfo) bubbleTextView.getTag();
|
WorkspaceItemInfo itemInfo = (WorkspaceItemInfo) bubbleTextView.getTag();
|
||||||
SearchTargetEvent event = new SearchTargetEvent.Builder(mSearchTarget,
|
SearchTargetEventLegacy event = new SearchTargetEventLegacy.Builder(mSearchTarget,
|
||||||
SearchTargetEvent.CHILD_SELECT).setShortcutPosition(itemInfo.rank).build();
|
SearchTargetEventLegacy.CHILD_SELECT).setShortcutPosition(
|
||||||
|
itemInfo.rank).build();
|
||||||
SearchEventTracker.getInstance(getContext()).notifySearchTargetEvent(event);
|
SearchEventTracker.getInstance(getContext()).notifySearchTargetEvent(event);
|
||||||
mLauncher.getItemOnClickListener().onClick(view);
|
mLauncher.getItemOnClickListener().onClick(view);
|
||||||
});
|
});
|
||||||
|
@ -111,7 +112,7 @@ public class SearchResultIconRow extends LinearLayout implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget searchTarget) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||||
mSearchTarget = searchTarget;
|
mSearchTarget = searchTarget;
|
||||||
mResultIcon.applySearchTarget(searchTarget, this);
|
mResultIcon.applySearchTarget(searchTarget, this);
|
||||||
String itemType = searchTarget.getItemType();
|
String itemType = searchTarget.getItemType();
|
||||||
|
|
|
@ -44,8 +44,8 @@ import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.icons.BitmapInfo;
|
import com.android.launcher3.icons.BitmapInfo;
|
||||||
import com.android.launcher3.icons.LauncherIcons;
|
import com.android.launcher3.icons.LauncherIcons;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ public class SearchResultPeopleView extends LinearLayout implements
|
||||||
private Intent mIntent;
|
private Intent mIntent;
|
||||||
|
|
||||||
|
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTargetLegacy mSearchTarget;
|
||||||
|
|
||||||
public SearchResultPeopleView(Context context) {
|
public SearchResultPeopleView(Context context) {
|
||||||
this(context, null, 0);
|
this(context, null, 0);
|
||||||
|
@ -99,11 +99,11 @@ public class SearchResultPeopleView extends LinearLayout implements
|
||||||
button.getLayoutParams().width = mButtonSize;
|
button.getLayoutParams().width = mButtonSize;
|
||||||
button.getLayoutParams().height = mButtonSize;
|
button.getLayoutParams().height = mButtonSize;
|
||||||
}
|
}
|
||||||
setOnClickListener(v -> handleSelection(SearchTargetEvent.SELECT));
|
setOnClickListener(v -> handleSelection(SearchTargetEventLegacy.SELECT));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget searchTarget) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||||
mSearchTarget = searchTarget;
|
mSearchTarget = searchTarget;
|
||||||
Bundle payload = searchTarget.getExtras();
|
Bundle payload = searchTarget.getExtras();
|
||||||
mTitleView.setText(payload.getString("title"));
|
mTitleView.setText(payload.getString("title"));
|
||||||
|
@ -186,8 +186,8 @@ public class SearchResultPeopleView extends LinearLayout implements
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putBundle("provider", provider);
|
bundle.putBundle("provider", provider);
|
||||||
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
||||||
new SearchTargetEvent.Builder(mSearchTarget,
|
new SearchTargetEventLegacy.Builder(mSearchTarget,
|
||||||
SearchTargetEvent.CHILD_SELECT).setExtras(bundle).build());
|
SearchTargetEventLegacy.CHILD_SELECT).setExtras(bundle).build());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ public class SearchResultPeopleView extends LinearLayout implements
|
||||||
Launcher launcher = Launcher.getLauncher(getContext());
|
Launcher launcher = Launcher.getLauncher(getContext());
|
||||||
launcher.startActivitySafely(this, mIntent, null);
|
launcher.startActivitySafely(this, mIntent, null);
|
||||||
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
||||||
new SearchTargetEvent.Builder(mSearchTarget, eventType).build());
|
new SearchTargetEventLegacy.Builder(mSearchTarget, eventType).build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,8 @@ import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.icons.BitmapRenderer;
|
import com.android.launcher3.icons.BitmapRenderer;
|
||||||
import com.android.launcher3.util.Themes;
|
import com.android.launcher3.util.Themes;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
@ -69,7 +69,7 @@ public class SearchResultPlayItem extends LinearLayout implements
|
||||||
private String mPackageName;
|
private String mPackageName;
|
||||||
private boolean mIsInstantGame;
|
private boolean mIsInstantGame;
|
||||||
|
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTargetLegacy mSearchTarget;
|
||||||
|
|
||||||
|
|
||||||
public SearchResultPlayItem(Context context) {
|
public SearchResultPlayItem(Context context) {
|
||||||
|
@ -101,7 +101,7 @@ public class SearchResultPlayItem extends LinearLayout implements
|
||||||
ViewGroup.LayoutParams iconParams = mIconView.getLayoutParams();
|
ViewGroup.LayoutParams iconParams = mIconView.getLayoutParams();
|
||||||
iconParams.height = mDeviceProfile.allAppsIconSizePx;
|
iconParams.height = mDeviceProfile.allAppsIconSizePx;
|
||||||
iconParams.width = mDeviceProfile.allAppsIconSizePx;
|
iconParams.width = mDeviceProfile.allAppsIconSizePx;
|
||||||
setOnClickListener(view -> handleSelection(SearchTargetEvent.SELECT));
|
setOnClickListener(view -> handleSelection(SearchTargetEventLegacy.SELECT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ public class SearchResultPlayItem extends LinearLayout implements
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget searchTarget) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||||
mSearchTarget = searchTarget;
|
mSearchTarget = searchTarget;
|
||||||
Bundle bundle = searchTarget.getExtras();
|
Bundle bundle = searchTarget.getExtras();
|
||||||
SearchEventTracker.INSTANCE.get(getContext()).registerWeakHandler(searchTarget, this);
|
SearchEventTracker.INSTANCE.get(getContext()).registerWeakHandler(searchTarget, this);
|
||||||
|
@ -193,11 +193,11 @@ public class SearchResultPlayItem extends LinearLayout implements
|
||||||
intent.putExtra("callerId", getContext().getPackageName());
|
intent.putExtra("callerId", getContext().getPackageName());
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
getContext().startActivity(intent);
|
getContext().startActivity(intent);
|
||||||
logSearchEvent(SearchTargetEvent.CHILD_SELECT);
|
logSearchEvent(SearchTargetEventLegacy.CHILD_SELECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void logSearchEvent(int eventType) {
|
private void logSearchEvent(int eventType) {
|
||||||
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
||||||
new SearchTargetEvent.Builder(mSearchTarget, eventType).build());
|
new SearchTargetEventLegacy.Builder(mSearchTarget, eventType).build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,8 @@ import androidx.slice.widget.SliceView;
|
||||||
|
|
||||||
import com.android.launcher3.Launcher;
|
import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A slice view wrapper with settings app icon at start
|
* A slice view wrapper with settings app icon at start
|
||||||
|
@ -50,7 +50,7 @@ public class SearchResultSettingsSlice extends LinearLayout implements
|
||||||
private SliceView mSliceView;
|
private SliceView mSliceView;
|
||||||
private View mIcon;
|
private View mIcon;
|
||||||
private LiveData<Slice> mSliceLiveData;
|
private LiveData<Slice> mSliceLiveData;
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTargetLegacy mSearchTarget;
|
||||||
private final Launcher mLauncher;
|
private final Launcher mLauncher;
|
||||||
|
|
||||||
public SearchResultSettingsSlice(Context context) {
|
public SearchResultSettingsSlice(Context context) {
|
||||||
|
@ -77,7 +77,7 @@ public class SearchResultSettingsSlice extends LinearLayout implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget searchTarget) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||||
reset();
|
reset();
|
||||||
mSearchTarget = searchTarget;
|
mSearchTarget = searchTarget;
|
||||||
try {
|
try {
|
||||||
|
@ -103,8 +103,8 @@ public class SearchResultSettingsSlice extends LinearLayout implements
|
||||||
@Override
|
@Override
|
||||||
public void handleSelection(int eventType) {
|
public void handleSelection(int eventType) {
|
||||||
SearchEventTracker.INSTANCE.get(mLauncher).notifySearchTargetEvent(
|
SearchEventTracker.INSTANCE.get(mLauncher).notifySearchTargetEvent(
|
||||||
new SearchTargetEvent.Builder(mSearchTarget,
|
new SearchTargetEventLegacy.Builder(mSearchTarget,
|
||||||
SearchTargetEvent.CHILD_SELECT).build());
|
SearchTargetEventLegacy.CHILD_SELECT).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reset() {
|
private void reset() {
|
||||||
|
@ -116,7 +116,7 @@ public class SearchResultSettingsSlice extends LinearLayout implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSliceAction(@NonNull EventInfo eventInfo, @NonNull SliceItem sliceItem) {
|
public void onSliceAction(@NonNull EventInfo eventInfo, @NonNull SliceItem sliceItem) {
|
||||||
handleSelection(SearchTargetEvent.CHILD_SELECT);
|
handleSelection(SearchTargetEventLegacy.CHILD_SELECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Uri getSliceUri() {
|
private Uri getSliceUri() {
|
||||||
|
|
|
@ -36,8 +36,8 @@ import com.android.launcher3.allapps.search.SearchWidgetInfoContainer;
|
||||||
import com.android.launcher3.dragndrop.DraggableView;
|
import com.android.launcher3.dragndrop.DraggableView;
|
||||||
import com.android.launcher3.touch.ItemLongClickListener;
|
import com.android.launcher3.touch.ItemLongClickListener;
|
||||||
import com.android.launcher3.widget.PendingAddWidgetInfo;
|
import com.android.launcher3.widget.PendingAddWidgetInfo;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* displays live version of a widget upon receiving {@link AppWidgetProviderInfo} from Search
|
* displays live version of a widget upon receiving {@link AppWidgetProviderInfo} from Search
|
||||||
|
@ -58,7 +58,7 @@ public class SearchResultWidget extends RelativeLayout implements
|
||||||
private final AppWidgetHostView mHostView;
|
private final AppWidgetHostView mHostView;
|
||||||
private final float mScaleToFit;
|
private final float mScaleToFit;
|
||||||
|
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTargetLegacy mSearchTarget;
|
||||||
private AppWidgetProviderInfo mProviderInfo;
|
private AppWidgetProviderInfo mProviderInfo;
|
||||||
|
|
||||||
private SearchWidgetInfoContainer mInfoContainer;
|
private SearchWidgetInfoContainer mInfoContainer;
|
||||||
|
@ -82,7 +82,7 @@ public class SearchResultWidget extends RelativeLayout implements
|
||||||
|
|
||||||
// detect tap event on widget container for search target event reporting
|
// detect tap event on widget container for search target event reporting
|
||||||
mClickDetector = new GestureDetector(context,
|
mClickDetector = new GestureDetector(context,
|
||||||
new ClickListener(() -> handleSelection(SearchTargetEvent.CHILD_SELECT)));
|
new ClickListener(() -> handleSelection(SearchTargetEventLegacy.CHILD_SELECT)));
|
||||||
|
|
||||||
mLongPressHelper = new CheckLongPressHelper(this);
|
mLongPressHelper = new CheckLongPressHelper(this);
|
||||||
mLongPressHelper.setLongPressTimeoutFactor(1);
|
mLongPressHelper.setLongPressTimeoutFactor(1);
|
||||||
|
@ -96,7 +96,7 @@ public class SearchResultWidget extends RelativeLayout implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget searchTarget) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||||
if (searchTarget.getExtras() == null
|
if (searchTarget.getExtras() == null
|
||||||
|| searchTarget.getExtras().getParcelable("provider") == null) {
|
|| searchTarget.getExtras().getParcelable("provider") == null) {
|
||||||
setVisibility(GONE);
|
setVisibility(GONE);
|
||||||
|
@ -141,7 +141,7 @@ public class SearchResultWidget extends RelativeLayout implements
|
||||||
@Override
|
@Override
|
||||||
public void handleSelection(int eventType) {
|
public void handleSelection(int eventType) {
|
||||||
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
||||||
new SearchTargetEvent.Builder(mSearchTarget, eventType).build());
|
new SearchTargetEventLegacy.Builder(mSearchTarget, eventType).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -182,7 +182,7 @@ public class SearchResultWidget extends RelativeLayout implements
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View view) {
|
public boolean onLongClick(View view) {
|
||||||
ItemLongClickListener.INSTANCE_ALL_APPS.onLongClick(view);
|
ItemLongClickListener.INSTANCE_ALL_APPS.onLongClick(view);
|
||||||
handleSelection(SearchTargetEvent.LONG_PRESS);
|
handleSelection(SearchTargetEventLegacy.LONG_PRESS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ import com.android.launcher3.widget.BaseWidgetSheet;
|
||||||
import com.android.launcher3.widget.PendingItemDragHelper;
|
import com.android.launcher3.widget.PendingItemDragHelper;
|
||||||
import com.android.launcher3.widget.WidgetCell;
|
import com.android.launcher3.widget.WidgetCell;
|
||||||
import com.android.launcher3.widget.WidgetImageView;
|
import com.android.launcher3.widget.WidgetImageView;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* displays preview of a widget upon receiving {@link AppWidgetProviderInfo} from Search provider
|
* displays preview of a widget upon receiving {@link AppWidgetProviderInfo} from Search provider
|
||||||
|
@ -55,7 +55,7 @@ public class SearchResultWidgetPreview extends LinearLayout implements
|
||||||
private WidgetCell mWidgetCell;
|
private WidgetCell mWidgetCell;
|
||||||
private Toast mWidgetToast;
|
private Toast mWidgetToast;
|
||||||
|
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTargetLegacy mSearchTarget;
|
||||||
|
|
||||||
|
|
||||||
public SearchResultWidgetPreview(Context context) {
|
public SearchResultWidgetPreview(Context context) {
|
||||||
|
@ -83,7 +83,7 @@ public class SearchResultWidgetPreview extends LinearLayout implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget searchTarget) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||||
if (searchTarget.getExtras() == null
|
if (searchTarget.getExtras() == null
|
||||||
|| searchTarget.getExtras().getParcelable("provider") == null) {
|
|| searchTarget.getExtras().getParcelable("provider") == null) {
|
||||||
setVisibility(GONE);
|
setVisibility(GONE);
|
||||||
|
@ -121,19 +121,19 @@ public class SearchResultWidgetPreview extends LinearLayout implements
|
||||||
new PendingItemDragHelper(mWidgetCell).startDrag(
|
new PendingItemDragHelper(mWidgetCell).startDrag(
|
||||||
imageView.getBitmapBounds(), imageView.getBitmap().getWidth(), imageView.getWidth(),
|
imageView.getBitmapBounds(), imageView.getBitmap().getWidth(), imageView.getWidth(),
|
||||||
new Point(loc[0], loc[1]), mLauncher.getAppsView(), new DragOptions());
|
new Point(loc[0], loc[1]), mLauncher.getAppsView(), new DragOptions());
|
||||||
handleSelection(SearchTargetEvent.LONG_PRESS);
|
handleSelection(SearchTargetEventLegacy.LONG_PRESS);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
mWidgetToast = BaseWidgetSheet.showWidgetToast(getContext(), mWidgetToast);
|
mWidgetToast = BaseWidgetSheet.showWidgetToast(getContext(), mWidgetToast);
|
||||||
handleSelection(SearchTargetEvent.SELECT);
|
handleSelection(SearchTargetEventLegacy.SELECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleSelection(int eventType) {
|
public void handleSelection(int eventType) {
|
||||||
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
||||||
new SearchTargetEvent.Builder(mSearchTarget, eventType).build());
|
new SearchTargetEventLegacy.Builder(mSearchTarget, eventType).build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Header text view that shows a title for a given section in All apps search
|
* Header text view that shows a title for a given section in All apps search
|
||||||
|
@ -44,7 +44,7 @@ public class SearchSectionHeaderView extends TextView implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget searchTarget) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||||
String title = searchTarget.getExtras().getString("title");
|
String title = searchTarget.getExtras().getString("title");
|
||||||
if (title == null || !title.isEmpty()) {
|
if (title == null || !title.isEmpty()) {
|
||||||
setText(title);
|
setText(title);
|
||||||
|
|
|
@ -38,8 +38,8 @@ import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.LauncherAppState;
|
import com.android.launcher3.LauncherAppState;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.model.data.PackageItemInfo;
|
import com.android.launcher3.model.data.PackageItemInfo;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -56,7 +56,7 @@ public class SearchSettingsRowView extends LinearLayout implements
|
||||||
private TextView mTitleView;
|
private TextView mTitleView;
|
||||||
private TextView mBreadcrumbsView;
|
private TextView mBreadcrumbsView;
|
||||||
private Intent mIntent;
|
private Intent mIntent;
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTargetLegacy mSearchTarget;
|
||||||
|
|
||||||
|
|
||||||
public SearchSettingsRowView(@NonNull Context context) {
|
public SearchSettingsRowView(@NonNull Context context) {
|
||||||
|
@ -84,7 +84,7 @@ public class SearchSettingsRowView extends LinearLayout implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget searchTarget) {
|
public void applySearchTarget(SearchTargetLegacy searchTarget) {
|
||||||
mSearchTarget = searchTarget;
|
mSearchTarget = searchTarget;
|
||||||
Bundle bundle = searchTarget.getExtras();
|
Bundle bundle = searchTarget.getExtras();
|
||||||
mIntent = bundle.getParcelable("intent");
|
mIntent = bundle.getParcelable("intent");
|
||||||
|
@ -108,7 +108,7 @@ public class SearchSettingsRowView extends LinearLayout implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
handleSelection(SearchTargetEvent.SELECT);
|
handleSelection(SearchTargetEventLegacy.SELECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -120,7 +120,7 @@ public class SearchSettingsRowView extends LinearLayout implements
|
||||||
launcher.startActivityForResult(mIntent, 0);
|
launcher.startActivityForResult(mIntent, 0);
|
||||||
|
|
||||||
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
||||||
new SearchTargetEvent.Builder(mSearchTarget, eventType).build());
|
new SearchTargetEventLegacy.Builder(mSearchTarget, eventType).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
|
|
||||||
package com.android.launcher3.search;
|
package com.android.launcher3.search;
|
||||||
|
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import android.app.search.SearchTarget;
|
||||||
|
|
||||||
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An interface for supporting dynamic search results
|
* An interface for supporting dynamic search results
|
||||||
|
@ -24,9 +26,16 @@ import com.android.systemui.plugins.shared.SearchTarget;
|
||||||
public interface SearchTargetHandler {
|
public interface SearchTargetHandler {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update view using values from {@link SearchTarget}
|
* Update view using values from {@link SearchTargetLegacy}
|
||||||
*/
|
*/
|
||||||
void applySearchTarget(SearchTarget searchTarget);
|
void applySearchTarget(SearchTargetLegacy searchTarget);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update view using values from {@link SearchTargetLegacy}
|
||||||
|
*/
|
||||||
|
default void applySearchTarget(SearchTarget searchTarget){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles selection of SearchTarget
|
* Handles selection of SearchTarget
|
||||||
|
|
|
@ -35,8 +35,8 @@ import com.android.launcher3.model.data.RemoteActionItemInfo;
|
||||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||||
import com.android.launcher3.touch.ItemClickHandler;
|
import com.android.launcher3.touch.ItemClickHandler;
|
||||||
import com.android.launcher3.util.Themes;
|
import com.android.launcher3.util.Themes;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A view representing a high confidence app search result that includes shortcuts
|
* A view representing a high confidence app search result that includes shortcuts
|
||||||
|
@ -47,7 +47,7 @@ public class ThumbnailSearchResultView extends androidx.appcompat.widget.AppComp
|
||||||
public static final String TARGET_TYPE_SCREENSHOT = "screenshot";
|
public static final String TARGET_TYPE_SCREENSHOT = "screenshot";
|
||||||
public static final String TARGET_TYPE_SCREENSHOT_LEGACY = "screenshot_legacy";
|
public static final String TARGET_TYPE_SCREENSHOT_LEGACY = "screenshot_legacy";
|
||||||
|
|
||||||
private SearchTarget mSearchTarget;
|
private SearchTargetLegacy mSearchTarget;
|
||||||
|
|
||||||
public ThumbnailSearchResultView(Context context) {
|
public ThumbnailSearchResultView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
@ -72,11 +72,11 @@ public class ThumbnailSearchResultView extends androidx.appcompat.widget.AppComp
|
||||||
ItemClickHandler.onClickAppShortcut(this, (WorkspaceItemInfo) itemInfo, launcher);
|
ItemClickHandler.onClickAppShortcut(this, (WorkspaceItemInfo) itemInfo, launcher);
|
||||||
}
|
}
|
||||||
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
SearchEventTracker.INSTANCE.get(getContext()).notifySearchTargetEvent(
|
||||||
new SearchTargetEvent.Builder(mSearchTarget, eventType).build());
|
new SearchTargetEventLegacy.Builder(mSearchTarget, eventType).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applySearchTarget(SearchTarget target) {
|
public void applySearchTarget(SearchTargetLegacy target) {
|
||||||
mSearchTarget = target;
|
mSearchTarget = target;
|
||||||
Bitmap bitmap;
|
Bitmap bitmap;
|
||||||
if (target.getRemoteAction() != null) {
|
if (target.getRemoteAction() != null) {
|
||||||
|
@ -108,7 +108,7 @@ public class ThumbnailSearchResultView extends androidx.appcompat.widget.AppComp
|
||||||
RoundedBitmapDrawable drawable = RoundedBitmapDrawableFactory.create(null, bitmap);
|
RoundedBitmapDrawable drawable = RoundedBitmapDrawableFactory.create(null, bitmap);
|
||||||
drawable.setCornerRadius(Themes.getDialogCornerRadius(getContext()));
|
drawable.setCornerRadius(Themes.getDialogCornerRadius(getContext()));
|
||||||
setImageDrawable(drawable);
|
setImageDrawable(drawable);
|
||||||
setOnClickListener(v -> handleSelection(SearchTargetEvent.SELECT));
|
setOnClickListener(v -> handleSelection(SearchTargetEventLegacy.SELECT));
|
||||||
SearchEventTracker.INSTANCE.get(getContext()).registerWeakHandler(target, this);
|
SearchEventTracker.INSTANCE.get(getContext()).registerWeakHandler(target, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.LauncherSettings.Favorites;
|
import com.android.launcher3.LauncherSettings.Favorites;
|
||||||
import com.android.launcher3.LauncherState;
|
import com.android.launcher3.LauncherState;
|
||||||
import com.android.launcher3.Workspace;
|
import com.android.launcher3.Workspace;
|
||||||
|
import com.android.launcher3.allapps.AllAppsContainerView;
|
||||||
import com.android.launcher3.allapps.search.SearchAdapterProvider;
|
import com.android.launcher3.allapps.search.SearchAdapterProvider;
|
||||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||||
import com.android.launcher3.appprediction.PredictionRowView;
|
import com.android.launcher3.appprediction.PredictionRowView;
|
||||||
|
@ -266,8 +267,8 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SearchAdapterProvider createSearchAdapterProvider() {
|
public SearchAdapterProvider createSearchAdapterProvider(AllAppsContainerView appsView) {
|
||||||
return new DeviceSearchAdapterProvider(this);
|
return new DeviceSearchAdapterProvider(this, appsView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -43,6 +43,7 @@ import android.widget.Toast;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.android.launcher3.LauncherSettings.Favorites;
|
import com.android.launcher3.LauncherSettings.Favorites;
|
||||||
|
import com.android.launcher3.allapps.AllAppsContainerView;
|
||||||
import com.android.launcher3.allapps.search.DefaultSearchAdapterProvider;
|
import com.android.launcher3.allapps.search.DefaultSearchAdapterProvider;
|
||||||
import com.android.launcher3.allapps.search.SearchAdapterProvider;
|
import com.android.launcher3.allapps.search.SearchAdapterProvider;
|
||||||
import com.android.launcher3.logging.InstanceId;
|
import com.android.launcher3.logging.InstanceId;
|
||||||
|
@ -297,7 +298,7 @@ public abstract class BaseDraggingActivity extends BaseActivity
|
||||||
* Creates and returns {@link SearchAdapterProvider} for build variant specific search result
|
* Creates and returns {@link SearchAdapterProvider} for build variant specific search result
|
||||||
* views
|
* views
|
||||||
*/
|
*/
|
||||||
public SearchAdapterProvider createSearchAdapterProvider() {
|
public SearchAdapterProvider createSearchAdapterProvider(AllAppsContainerView allapps) {
|
||||||
return new DefaultSearchAdapterProvider(this);
|
return new DefaultSearchAdapterProvider(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||||
mLauncher = BaseDraggingActivity.fromContext(context);
|
mLauncher = BaseDraggingActivity.fromContext(context);
|
||||||
mLauncher.addOnDeviceProfileChangeListener(this);
|
mLauncher.addOnDeviceProfileChangeListener(this);
|
||||||
|
|
||||||
mSearchAdapterProvider = mLauncher.createSearchAdapterProvider();
|
mSearchAdapterProvider = mLauncher.createSearchAdapterProvider(this);
|
||||||
mSearchQueryBuilder = new SpannableStringBuilder();
|
mSearchQueryBuilder = new SpannableStringBuilder();
|
||||||
Selection.setSelection(mSearchQueryBuilder, 0);
|
Selection.setSelection(mSearchQueryBuilder, 0);
|
||||||
|
|
||||||
|
@ -569,6 +569,10 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SearchAdapterProvider getSearchAdapterProvider() {
|
||||||
|
return mSearchAdapterProvider;
|
||||||
|
}
|
||||||
|
|
||||||
public RecyclerViewFastScroller getScrollBar() {
|
public RecyclerViewFastScroller getScrollBar() {
|
||||||
AllAppsRecyclerView rv = getActiveRecyclerView();
|
AllAppsRecyclerView rv = getActiveRecyclerView();
|
||||||
return rv == null ? null : rv.getScrollbar();
|
return rv == null ? null : rv.getScrollbar();
|
||||||
|
|
|
@ -98,6 +98,10 @@ public final class FeatureFlags {
|
||||||
public static final BooleanFlag ENABLE_DEVICE_SEARCH = getDebugFlag(
|
public static final BooleanFlag ENABLE_DEVICE_SEARCH = getDebugFlag(
|
||||||
"ENABLE_DEVICE_SEARCH", false, "Allows on device search in all apps");
|
"ENABLE_DEVICE_SEARCH", false, "Allows on device search in all apps");
|
||||||
|
|
||||||
|
public static final BooleanFlag SEARCH_TARGET_LEGACY = getDebugFlag(
|
||||||
|
"SEARCH_TARGET_LEGACY", true,
|
||||||
|
"Use SearchTarget provided by plugin lib (only during migration)");
|
||||||
|
|
||||||
public static final BooleanFlag DISABLE_INITIAL_IME_IN_ALLAPPS = getDebugFlag(
|
public static final BooleanFlag DISABLE_INITIAL_IME_IN_ALLAPPS = getDebugFlag(
|
||||||
"DISABLE_INITIAL_IME_IN_ALLAPPS", false, "Disable default IME state in all apps");
|
"DISABLE_INITIAL_IME_IN_ALLAPPS", false, "Disable default IME state in all apps");
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,12 @@ package com.android.systemui.plugins;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.CancellationSignal;
|
import android.os.CancellationSignal;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import com.android.systemui.plugins.annotations.ProvidesInterface;
|
import com.android.systemui.plugins.annotations.ProvidesInterface;
|
||||||
import com.android.systemui.plugins.shared.SearchTarget;
|
import com.android.systemui.plugins.shared.SearchTargetEventLegacy;
|
||||||
import com.android.systemui.plugins.shared.SearchTargetEvent;
|
import com.android.systemui.plugins.shared.SearchTargetLegacy;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
@ -34,20 +35,25 @@ import java.util.function.Consumer;
|
||||||
@ProvidesInterface(action = AllAppsSearchPlugin.ACTION, version = AllAppsSearchPlugin.VERSION)
|
@ProvidesInterface(action = AllAppsSearchPlugin.ACTION, version = AllAppsSearchPlugin.VERSION)
|
||||||
public interface AllAppsSearchPlugin extends Plugin {
|
public interface AllAppsSearchPlugin extends Plugin {
|
||||||
String ACTION = "com.android.systemui.action.PLUGIN_ALL_APPS_SEARCH_ACTIONS";
|
String ACTION = "com.android.systemui.action.PLUGIN_ALL_APPS_SEARCH_ACTIONS";
|
||||||
int VERSION = 8;
|
int VERSION = 9;
|
||||||
|
|
||||||
void setup(Activity activity, View view);
|
/**
|
||||||
|
* init plugin
|
||||||
|
*/
|
||||||
|
void setup(Activity activity, View view, boolean useLegacy);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send launcher state related signals.
|
* Send launcher state related signals.
|
||||||
*/
|
*/
|
||||||
void onStateTransitionStart(int fromState, int toState);
|
void onStateTransitionStart(int fromState, int toState);
|
||||||
|
|
||||||
void onStateTransitionComplete(int state);
|
void onStateTransitionComplete(int state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send launcher window focus and visibility changed signals.
|
* Send launcher window focus and visibility changed signals.
|
||||||
*/
|
*/
|
||||||
void onWindowFocusChanged(boolean hasFocus);
|
void onWindowFocusChanged(boolean hasFocus);
|
||||||
|
|
||||||
void onWindowVisibilityChanged(int visibility);
|
void onWindowVisibilityChanged(int visibility);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,22 +65,41 @@ public interface AllAppsSearchPlugin extends Plugin {
|
||||||
/**
|
/**
|
||||||
* Main function that triggers search.
|
* Main function that triggers search.
|
||||||
*
|
*
|
||||||
* @param input string that has been typed by a user
|
* @param input string that has been typed by a user
|
||||||
* @param inputArgs extra info that may be relevant for the input query
|
* @param inputArgs extra info that may be relevant for the input query
|
||||||
* @param results contains the result that will be rendered in all apps search surface
|
* @param results contains the result that will be rendered in all apps search
|
||||||
|
* surface
|
||||||
* @param cancellationSignal {@link CancellationSignal} can be used to share status of current
|
* @param cancellationSignal {@link CancellationSignal} can be used to share status of current
|
||||||
*/
|
*/
|
||||||
void query(String input, Bundle inputArgs, Consumer<List<SearchTarget>> results,
|
void queryLegacy(String input, Bundle inputArgs, Consumer<List<SearchTargetLegacy>> results,
|
||||||
|
CancellationSignal cancellationSignal);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main function that triggers search.
|
||||||
|
*
|
||||||
|
* @param input string that has been typed by a user
|
||||||
|
* @param inputArgs extra info that may be relevant for the input query
|
||||||
|
* @param results contains the result that will be rendered in all apps search
|
||||||
|
* surface
|
||||||
|
* @param cancellationSignal {@link CancellationSignal} can be used to share status of current
|
||||||
|
*/
|
||||||
|
void query(String input, Bundle inputArgs, Consumer<List<Parcelable>> results,
|
||||||
CancellationSignal cancellationSignal);
|
CancellationSignal cancellationSignal);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send over search target interaction events to Plugin
|
* Send over search target interaction events to Plugin
|
||||||
*/
|
*/
|
||||||
void notifySearchTargetEvent(SearchTargetEvent event);
|
void notifySearchTargetEventLegacy(SearchTargetEventLegacy event);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send over search target interaction events to Plugin
|
||||||
|
*/
|
||||||
|
void notifySearchTargetEvent(Parcelable event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launcher activity lifecycle callbacks
|
* Launcher activity lifecycle callbacks
|
||||||
*/
|
*/
|
||||||
void onResume(int state);
|
void onResume(int state);
|
||||||
|
|
||||||
void onStop(int state);
|
void onStop(int state);
|
||||||
}
|
}
|
|
@ -19,8 +19,11 @@ import android.os.Bundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event used for the feedback loop to the plugin. (and future aiai)
|
* Event used for the feedback loop to the plugin. (and future aiai)
|
||||||
|
*
|
||||||
|
* @deprecated Use SearchTargetEvent
|
||||||
*/
|
*/
|
||||||
public class SearchTargetEvent {
|
@Deprecated
|
||||||
|
public class SearchTargetEventLegacy {
|
||||||
public static final int POSITION_NONE = -1;
|
public static final int POSITION_NONE = -1;
|
||||||
|
|
||||||
public static final int SELECT = 0;
|
public static final int SELECT = 0;
|
||||||
|
@ -28,12 +31,13 @@ public class SearchTargetEvent {
|
||||||
public static final int LONG_PRESS = 2;
|
public static final int LONG_PRESS = 2;
|
||||||
public static final int CHILD_SELECT = 3;
|
public static final int CHILD_SELECT = 3;
|
||||||
|
|
||||||
private final SearchTarget mSearchTarget;
|
private final SearchTargetLegacy mSearchTarget;
|
||||||
private final int mEventType;
|
private final int mEventType;
|
||||||
private final int mShortcutPosition;
|
private final int mShortcutPosition;
|
||||||
private final Bundle mExtras;
|
private final Bundle mExtras;
|
||||||
|
|
||||||
public SearchTargetEvent(SearchTarget searchTarget, int eventType, int shortcutPosition,
|
public SearchTargetEventLegacy(SearchTargetLegacy searchTarget, int eventType,
|
||||||
|
int shortcutPosition,
|
||||||
Bundle extras) {
|
Bundle extras) {
|
||||||
mSearchTarget = searchTarget;
|
mSearchTarget = searchTarget;
|
||||||
mEventType = eventType;
|
mEventType = eventType;
|
||||||
|
@ -42,7 +46,7 @@ public class SearchTargetEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public SearchTarget getSearchTarget() {
|
public SearchTargetLegacy getSearchTarget() {
|
||||||
return mSearchTarget;
|
return mSearchTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,15 +63,15 @@ public class SearchTargetEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A builder for {@link SearchTarget}
|
* A builder for {@link SearchTargetLegacy}
|
||||||
*/
|
*/
|
||||||
public static final class Builder {
|
public static final class Builder {
|
||||||
private final SearchTarget mSearchTarget;
|
private final SearchTargetLegacy mSearchTarget;
|
||||||
private final int mEventType;
|
private final int mEventType;
|
||||||
private int mShortcutPosition = POSITION_NONE;
|
private int mShortcutPosition = POSITION_NONE;
|
||||||
private Bundle mExtras;
|
private Bundle mExtras;
|
||||||
|
|
||||||
public Builder(SearchTarget searchTarget, int eventType) {
|
public Builder(SearchTargetLegacy searchTarget, int eventType) {
|
||||||
mSearchTarget = searchTarget;
|
mSearchTarget = searchTarget;
|
||||||
mEventType = eventType;
|
mEventType = eventType;
|
||||||
}
|
}
|
||||||
|
@ -82,8 +86,9 @@ public class SearchTargetEvent {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SearchTargetEvent build() {
|
public SearchTargetEventLegacy build() {
|
||||||
return new SearchTargetEvent(mSearchTarget, mEventType, mShortcutPosition, mExtras);
|
return new SearchTargetEventLegacy(mSearchTarget, mEventType, mShortcutPosition,
|
||||||
|
mExtras);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,11 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to return all apps search targets.
|
* Used to return all apps search targets.
|
||||||
|
*
|
||||||
|
* @deprecated Use SearchTarget
|
||||||
*/
|
*/
|
||||||
public class SearchTarget implements Comparable<SearchTarget> {
|
@Deprecated
|
||||||
|
public class SearchTargetLegacy implements Comparable<SearchTargetLegacy> {
|
||||||
|
|
||||||
private final String mItemId;
|
private final String mItemId;
|
||||||
private final String mItemType;
|
private final String mItemType;
|
||||||
|
@ -39,7 +42,7 @@ public class SearchTarget implements Comparable<SearchTarget> {
|
||||||
private final RemoteAction mRemoteAction;
|
private final RemoteAction mRemoteAction;
|
||||||
private final Bundle mExtras;
|
private final Bundle mExtras;
|
||||||
|
|
||||||
private SearchTarget(String itemId, String itemType, float score,
|
private SearchTargetLegacy(String itemId, String itemType, float score,
|
||||||
ComponentName componentName, UserHandle userHandle, List<ShortcutInfo> shortcutInfos,
|
ComponentName componentName, UserHandle userHandle, List<ShortcutInfo> shortcutInfos,
|
||||||
RemoteAction remoteAction, Bundle extras) {
|
RemoteAction remoteAction, Bundle extras) {
|
||||||
mItemId = itemId;
|
mItemId = itemId;
|
||||||
|
@ -85,12 +88,12 @@ public class SearchTarget implements Comparable<SearchTarget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(SearchTarget o) {
|
public int compareTo(SearchTargetLegacy o) {
|
||||||
return Float.compare(o.mScore, mScore);
|
return Float.compare(o.mScore, mScore);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A builder for {@link SearchTarget}
|
* A builder for {@link SearchTargetLegacy}
|
||||||
*/
|
*/
|
||||||
public static final class Builder {
|
public static final class Builder {
|
||||||
|
|
||||||
|
@ -158,13 +161,13 @@ public class SearchTarget implements Comparable<SearchTarget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds a {@link SearchTarget}
|
* Builds a {@link SearchTargetLegacy}
|
||||||
*/
|
*/
|
||||||
public SearchTarget build() {
|
public SearchTargetLegacy build() {
|
||||||
if (mItemId == null) {
|
if (mItemId == null) {
|
||||||
throw new IllegalStateException("Item ID is required for building SearchTarget");
|
throw new IllegalStateException("Item ID is required for building SearchTarget");
|
||||||
}
|
}
|
||||||
return new SearchTarget(mItemId, mItemType, mScore, mComponentName, mUserHandle,
|
return new SearchTargetLegacy(mItemId, mItemType, mScore, mComponentName, mUserHandle,
|
||||||
mShortcutInfos,
|
mShortcutInfos,
|
||||||
mRemoteAction, mExtras);
|
mRemoteAction, mExtras);
|
||||||
}
|
}
|
Loading…
Reference in New Issue