Migrate from Plugin SearchTarget to API search Target [3/3]

- Implement SearchServicePipeline which utilizes system Search services for AllAppsSearch Results
- Parse android.app.search.SearchTarget handling for Shortcut, Slice, Settings and Play results
- Aggregate SearchTargets to a tree structure for in-line Search Results

Bug: 177223401
Test: Manual
Change-Id: Iddc0f3691578fd332cd2df643a237b29f3eccd0d
This commit is contained in:
Samuel Fufa committed 2021-01-19 14:29:13 -06:00
1 parent 7cb41c3584
commit bdf4f71299
13 files changed
+309 -100

No files matched your search

@@ -18,6 +18,7 @@ package com.android.launcher3.search;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import android.app.search.SearchTarget;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ShortcutInfo;
@@ -32,6 +33,7 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import com.android.app.search.ResultType;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
@@ -111,6 +113,16 @@ public class SearchResultIconRow extends LinearLayout implements
setOnLongClickListener(this);
}
@Override
public void applySearchTarget(SearchTarget parentTarget, List<SearchTarget> children) {
mResultIcon.applySearchTarget(parentTarget, children, this);
if (parentTarget.getResultType() == ResultType.SHORTCUT) {
ShortcutInfo shortcutInfo = parentTarget.getShortcutInfo();
setProviderDetails(new ComponentName(shortcutInfo.getPackage(), ""),
shortcutInfo.getUserHandle());
}
}
@Override
public void applySearchTarget(SearchTargetLegacy searchTarget) {
mSearchTarget = searchTarget;