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

@@ -19,6 +19,8 @@ import static com.android.launcher3.FastBitmapDrawable.newIcon;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import android.app.search.SearchAction;
import android.app.search.SearchTarget;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -97,6 +99,14 @@ public class SearchSettingsRowView extends LinearLayout implements
SearchEventTracker.INSTANCE.get(getContext()).registerWeakHandler(searchTarget, this);
}
@Override
public void applySearchTarget(SearchTarget parentTarget, List<SearchTarget> children) {
SearchAction action = parentTarget.getSearchAction();
mIconView.setContentDescription(action.getTitle());
showIfAvailable(mTitleView, action.getTitle().toString());
showIfAvailable(mBreadcrumbsView, action.getSubtitle().toString());
}
private void showIfAvailable(TextView view, @Nullable String string) {
if (TextUtils.isEmpty(string)) {
view.setVisibility(GONE);