Loading core/java/com/android/internal/app/ChooserActivity.java +14 −1 Original line number Original line Diff line number Diff line Loading @@ -691,8 +691,14 @@ public class ChooserActivity extends ResolverActivity implements mPinnedSharedPrefs = getPinnedSharedPrefs(this); mPinnedSharedPrefs = getPinnedSharedPrefs(this); pa = intent.getParcelableArrayExtra(Intent.EXTRA_EXCLUDE_COMPONENTS); pa = intent.getParcelableArrayExtra(Intent.EXTRA_EXCLUDE_COMPONENTS); // Exclude out Nearby from main list if chip is present, to avoid duplication ComponentName nearbySharingComponent = getNearbySharingComponent(); boolean hasNearby = nearbySharingComponent != null; if (pa != null) { if (pa != null) { ComponentName[] names = new ComponentName[pa.length]; ComponentName[] names = new ComponentName[pa.length + (hasNearby ? 1 : 0)]; for (int i = 0; i < pa.length; i++) { for (int i = 0; i < pa.length; i++) { if (!(pa[i] instanceof ComponentName)) { if (!(pa[i] instanceof ComponentName)) { Log.w(TAG, "Filtered component #" + i + " not a ComponentName: " + pa[i]); Log.w(TAG, "Filtered component #" + i + " not a ComponentName: " + pa[i]); Loading @@ -701,7 +707,14 @@ public class ChooserActivity extends ResolverActivity implements } } names[i] = (ComponentName) pa[i]; names[i] = (ComponentName) pa[i]; } } if (hasNearby) { names[names.length - 1] = nearbySharingComponent; } mFilteredComponentNames = names; mFilteredComponentNames = names; } else if (hasNearby) { mFilteredComponentNames = new ComponentName[1]; mFilteredComponentNames[0] = nearbySharingComponent; } } pa = intent.getParcelableArrayExtra(Intent.EXTRA_CHOOSER_TARGETS); pa = intent.getParcelableArrayExtra(Intent.EXTRA_CHOOSER_TARGETS); Loading Loading
core/java/com/android/internal/app/ChooserActivity.java +14 −1 Original line number Original line Diff line number Diff line Loading @@ -691,8 +691,14 @@ public class ChooserActivity extends ResolverActivity implements mPinnedSharedPrefs = getPinnedSharedPrefs(this); mPinnedSharedPrefs = getPinnedSharedPrefs(this); pa = intent.getParcelableArrayExtra(Intent.EXTRA_EXCLUDE_COMPONENTS); pa = intent.getParcelableArrayExtra(Intent.EXTRA_EXCLUDE_COMPONENTS); // Exclude out Nearby from main list if chip is present, to avoid duplication ComponentName nearbySharingComponent = getNearbySharingComponent(); boolean hasNearby = nearbySharingComponent != null; if (pa != null) { if (pa != null) { ComponentName[] names = new ComponentName[pa.length]; ComponentName[] names = new ComponentName[pa.length + (hasNearby ? 1 : 0)]; for (int i = 0; i < pa.length; i++) { for (int i = 0; i < pa.length; i++) { if (!(pa[i] instanceof ComponentName)) { if (!(pa[i] instanceof ComponentName)) { Log.w(TAG, "Filtered component #" + i + " not a ComponentName: " + pa[i]); Log.w(TAG, "Filtered component #" + i + " not a ComponentName: " + pa[i]); Loading @@ -701,7 +707,14 @@ public class ChooserActivity extends ResolverActivity implements } } names[i] = (ComponentName) pa[i]; names[i] = (ComponentName) pa[i]; } } if (hasNearby) { names[names.length - 1] = nearbySharingComponent; } mFilteredComponentNames = names; mFilteredComponentNames = names; } else if (hasNearby) { mFilteredComponentNames = new ComponentName[1]; mFilteredComponentNames[0] = nearbySharingComponent; } } pa = intent.getParcelableArrayExtra(Intent.EXTRA_CHOOSER_TARGETS); pa = intent.getParcelableArrayExtra(Intent.EXTRA_CHOOSER_TARGETS); Loading