Merge "Sharesheet - Limit EXTRA_INITIAL_INTENTS to 2" into qt-dev
am: 4c648a027f
Change-Id: I8e1d67837dd591d53cd3750919e17d3bb72f2247
This commit is contained in:
@@ -212,6 +212,8 @@ public class ChooserActivity extends ResolverActivity {
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public static final int LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS = 250;
|
public static final int LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS = 250;
|
||||||
|
|
||||||
|
private static final int MAX_EXTRA_INITIAL_INTENTS = 2;
|
||||||
|
|
||||||
private boolean mListViewDataChanged = false;
|
private boolean mListViewDataChanged = false;
|
||||||
|
|
||||||
@Retention(SOURCE)
|
@Retention(SOURCE)
|
||||||
@@ -356,8 +358,9 @@ public class ChooserActivity extends ResolverActivity {
|
|||||||
Parcelable[] pa = intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
|
Parcelable[] pa = intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
|
||||||
Intent[] initialIntents = null;
|
Intent[] initialIntents = null;
|
||||||
if (pa != null) {
|
if (pa != null) {
|
||||||
initialIntents = new Intent[pa.length];
|
int count = Math.min(pa.length, MAX_EXTRA_INITIAL_INTENTS);
|
||||||
for (int i = 0; i < pa.length; i++) {
|
initialIntents = new Intent[count];
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
if (!(pa[i] instanceof Intent)) {
|
if (!(pa[i] instanceof Intent)) {
|
||||||
Log.w(TAG, "Initial intent #" + i + " not an Intent: " + pa[i]);
|
Log.w(TAG, "Initial intent #" + i + " not an Intent: " + pa[i]);
|
||||||
finish();
|
finish();
|
||||||
|
|||||||
Reference in New Issue
Block a user