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

Commit 4c648a02 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Sharesheet - Limit EXTRA_INITIAL_INTENTS to 2" into qt-dev

parents 3642e79f 4e2e3632
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -212,6 +212,8 @@ public class ChooserActivity extends ResolverActivity {
    @VisibleForTesting
    public static final int LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS = 250;

    private static final int MAX_EXTRA_INITIAL_INTENTS = 2;

    private boolean mListViewDataChanged = false;

    @Retention(SOURCE)
@@ -356,8 +358,9 @@ public class ChooserActivity extends ResolverActivity {
        Parcelable[] pa = intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
        Intent[] initialIntents = null;
        if (pa != null) {
            initialIntents = new Intent[pa.length];
            for (int i = 0; i < pa.length; i++) {
            int count = Math.min(pa.length, MAX_EXTRA_INITIAL_INTENTS);
            initialIntents = new Intent[count];
            for (int i = 0; i < count; i++) {
                if (!(pa[i] instanceof Intent)) {
                    Log.w(TAG, "Initial intent #" + i + " not an Intent: " + pa[i]);
                    finish();