Handle tap on intent based search results.

Also fix how icon is loaded. IconResId is specific to the package of the
indexed result. If result comes from external app, icon needs to be
decoded against the external app's package context.

Bug: 33432310
Test: RunSettingsRoboTests
Change-Id: Ia0c53e63be757405dfaeceb2d865e7d8de87c5ee
This commit is contained in:
Fan Zhang
2016-12-08 15:40:05 -08:00
parent 6c6c0e1151
commit 12daf6830d
6 changed files with 166 additions and 58 deletions

View File

@@ -44,6 +44,9 @@ public class IntentSearchViewHolder extends SearchViewHolder {
titleView.setText(result.title);
summaryView.setText(result.summary);
iconView.setImageDrawable(result.icon);
if (result.icon == null) {
iconView.setBackgroundResource(R.drawable.empty_icon);
}
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {