Forcefully convert to basic Intent before calling PM API.

AIDL can't accept subclasses, see more info in the bug

Bug: 223022163
Fixes: 223022163
Test: launch WSJ, click on share
Change-Id: I0015fda3a6fb741b109f7d3d00df1da6f7d64863
This commit is contained in:
Alex Buynytskyy
2022-05-09 09:17:23 -07:00
parent 0a6445f43b
commit 7e0ab65145

View File

@@ -144,7 +144,9 @@ public class ChooserListAdapter extends ResolverListAdapter {
}
}
if (ai == null) {
ri = packageManager.resolveActivity(ii, PackageManager.MATCH_DEFAULT_ONLY);
// Because of AIDL bug, resolveActivity can't accept subclasses of Intent.
final Intent rii = (ii.getClass() == Intent.class) ? ii : new Intent(ii);
ri = packageManager.resolveActivity(rii, PackageManager.MATCH_DEFAULT_ONLY);
ai = ri != null ? ri.activityInfo : null;
}
if (ai == null) {