Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 682df5bb authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Forcefully convert to basic Intent before calling PM API.

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

Bug: 238277108
Fixes: 238277108
Test: follow steps in the bug, click on share
Change-Id: Ie691df4566e6b622c868bbed4377afc1ee82807d
parent d69a267b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -417,8 +417,9 @@ public class ResolverListAdapter extends BaseAdapter {
                    if (ii == null) {
                        continue;
                    }
                    ActivityInfo ai = ii.resolveActivityInfo(
                            mPm, 0);
                    // Because of AIDL bug, resolveActivityInfo can't accept subclasses of Intent.
                    final Intent rii = (ii.getClass() == Intent.class) ? ii : new Intent(ii);
                    ActivityInfo ai = rii.resolveActivityInfo(mPm, 0);
                    if (ai == null) {
                        Log.w(TAG, "No activity found for " + ii);
                        continue;
+4 −1
Original line number Diff line number Diff line
@@ -136,12 +136,15 @@ public class ResolverListController {
            int baseFlags) {
        List<ResolverActivity.ResolvedComponentInfo> resolvedComponents = null;
        for (int i = 0, N = intents.size(); i < N; i++) {
            final Intent intent = intents.get(i);
            Intent intent = intents.get(i);
            int flags = baseFlags;
            if (intent.isWebIntent()
                        || (intent.getFlags() & Intent.FLAG_ACTIVITY_MATCH_EXTERNAL) != 0) {
                flags |= PackageManager.MATCH_INSTANT;
            }
            // Because of AIDL bug, queryIntentActivitiesAsUser can't accept subclasses of Intent.
            intent = (intent.getClass() == Intent.class) ? intent : new Intent(
                    intent);
            final List<ResolveInfo> infos = mpm.queryIntentActivitiesAsUser(intent, flags,
                    userHandle);
            if (infos != null) {