Revert "Don't use ProxyActivity when launching from SearchActionItemInfo intent"

This reverts commit 878dedfb84.

Reason for revert: b/192558017
Bug: 192558017

Change-Id: I41e64ab74c00d7b255be6f3ef1b783c01571d641
This commit is contained in:
Hyunyoung Song
2021-07-02 19:13:28 +00:00
parent 878dedfb84
commit 5881b910e9
2 changed files with 10 additions and 8 deletions

View File

@@ -262,12 +262,19 @@ public class ItemClickHandler {
*/
public static void onClickSearchAction(Launcher launcher, SearchActionItemInfo itemInfo) {
if (itemInfo.getIntent() != null) {
launcher.startActivity(itemInfo.getIntent());
if (itemInfo.hasFlags(SearchActionItemInfo.FLAG_SHOULD_START_FOR_RESULT)) {
launcher.startActivityForResult(itemInfo.getIntent(), 0);
} else {
launcher.startActivity(itemInfo.getIntent());
}
} else if (itemInfo.getPendingIntent() != null) {
try {
PendingIntent pendingIntent = itemInfo.getPendingIntent();
if (!itemInfo.hasFlags(SearchActionItemInfo.FLAG_SHOULD_START)) {
pendingIntent.send();
} else if (itemInfo.hasFlags(SearchActionItemInfo.FLAG_SHOULD_START_FOR_RESULT)) {
launcher.startIntentSenderForResult(pendingIntent.getIntentSender(), 0, null, 0,
0, 0);
} else {
launcher.startIntentSender(pendingIntent.getIntentSender(), null, 0, 0, 0);
}