[pixel-search] Bug fix: automatically launch screenshot + center&crop remoteaction icon

Bug: b/169330678
Change-Id: Id5f8a0ce6d68f7ed9e4d1ff258ee3772229eb63b
This commit is contained in:
Hilary Huo committed 2020-10-01 12:26:48 -07:00
1 parent 24c81ad7b5
commit f6b72c4ad1
1 file changed
+5 -2
@@ -86,9 +86,12 @@ public class ThumbnailSearchResultView extends androidx.appcompat.widget.AppComp
RemoteActionItemInfo itemInfo = new RemoteActionItemInfo(target.mRemoteAction,
target.bundle.getString(SearchTarget.REMOTE_ACTION_TOKEN),
target.bundle.getBoolean(SearchTarget.REMOTE_ACTION_SHOULD_START));
ItemClickHandler.onClickRemoteAction(launcher, itemInfo);
bitmap = ((BitmapDrawable) target.mRemoteAction.getIcon()
.loadDrawable(getContext())).getBitmap();
.loadDrawable(getContext())).getBitmap();
Bitmap crop = Bitmap.createBitmap(bitmap, 0,
bitmap.getHeight() / 2 - bitmap.getWidth() / 2,
bitmap.getWidth(), bitmap.getWidth());
bitmap = crop;
setTag(itemInfo);
} else {
bitmap = (Bitmap) target.bundle.getParcelable("bitmap");