Loading core/java/com/android/internal/app/ChooserActivity.java +10 −1 Original line number Diff line number Diff line Loading @@ -517,6 +517,7 @@ public class ChooserActivity extends ResolverActivity { private final ResolveInfo mBackupResolveInfo; private final ChooserTarget mChooserTarget; private Drawable mBadgeIcon = null; private CharSequence mBadgeContentDescription; private Drawable mDisplayIcon; private final Intent mFillInIntent; private final int mFillInFlags; Loading @@ -532,7 +533,9 @@ public class ChooserActivity extends ResolverActivity { if (ri != null) { final ActivityInfo ai = ri.activityInfo; if (ai != null && ai.applicationInfo != null) { mBadgeIcon = getPackageManager().getApplicationIcon(ai.applicationInfo); final PackageManager pm = getPackageManager(); mBadgeIcon = pm.getApplicationIcon(ai.applicationInfo); mBadgeContentDescription = pm.getApplicationLabel(ai.applicationInfo); } } } Loading @@ -555,6 +558,7 @@ public class ChooserActivity extends ResolverActivity { mBackupResolveInfo = other.mBackupResolveInfo; mChooserTarget = other.mChooserTarget; mBadgeIcon = other.mBadgeIcon; mBadgeContentDescription = other.mBadgeContentDescription; mDisplayIcon = other.mDisplayIcon; mFillInIntent = fillInIntent; mFillInFlags = flags; Loading Loading @@ -646,6 +650,11 @@ public class ChooserActivity extends ResolverActivity { return mBadgeIcon; } @Override public CharSequence getBadgeContentDescription() { return mBadgeContentDescription; } @Override public TargetInfo cloneFilledIn(Intent fillInIntent, int flags) { return new ChooserTargetInfo(this, fillInIntent, flags); Loading core/java/com/android/internal/app/ResolverActivity.java +11 −0 Original line number Diff line number Diff line Loading @@ -931,6 +931,11 @@ public class ResolverActivity extends Activity { return null; } @Override public CharSequence getBadgeContentDescription() { return null; } @Override public TargetInfo cloneFilledIn(Intent fillInIntent, int flags) { return new DisplayResolveInfo(this, fillInIntent, flags); Loading Loading @@ -1071,6 +1076,11 @@ public class ResolverActivity extends Activity { */ public Drawable getBadgeIcon(); /** * @return The content description for the badge icon */ public CharSequence getBadgeContentDescription(); /** * Clone this target with the given fill-in information. */ Loading Loading @@ -1542,6 +1552,7 @@ public class ResolverActivity extends Activity { final Drawable badge = info.getBadgeIcon(); if (badge != null) { holder.badge.setImageDrawable(badge); holder.badge.setContentDescription(info.getBadgeContentDescription()); holder.badge.setVisibility(View.VISIBLE); } else { holder.badge.setVisibility(View.GONE); Loading Loading
core/java/com/android/internal/app/ChooserActivity.java +10 −1 Original line number Diff line number Diff line Loading @@ -517,6 +517,7 @@ public class ChooserActivity extends ResolverActivity { private final ResolveInfo mBackupResolveInfo; private final ChooserTarget mChooserTarget; private Drawable mBadgeIcon = null; private CharSequence mBadgeContentDescription; private Drawable mDisplayIcon; private final Intent mFillInIntent; private final int mFillInFlags; Loading @@ -532,7 +533,9 @@ public class ChooserActivity extends ResolverActivity { if (ri != null) { final ActivityInfo ai = ri.activityInfo; if (ai != null && ai.applicationInfo != null) { mBadgeIcon = getPackageManager().getApplicationIcon(ai.applicationInfo); final PackageManager pm = getPackageManager(); mBadgeIcon = pm.getApplicationIcon(ai.applicationInfo); mBadgeContentDescription = pm.getApplicationLabel(ai.applicationInfo); } } } Loading @@ -555,6 +558,7 @@ public class ChooserActivity extends ResolverActivity { mBackupResolveInfo = other.mBackupResolveInfo; mChooserTarget = other.mChooserTarget; mBadgeIcon = other.mBadgeIcon; mBadgeContentDescription = other.mBadgeContentDescription; mDisplayIcon = other.mDisplayIcon; mFillInIntent = fillInIntent; mFillInFlags = flags; Loading Loading @@ -646,6 +650,11 @@ public class ChooserActivity extends ResolverActivity { return mBadgeIcon; } @Override public CharSequence getBadgeContentDescription() { return mBadgeContentDescription; } @Override public TargetInfo cloneFilledIn(Intent fillInIntent, int flags) { return new ChooserTargetInfo(this, fillInIntent, flags); Loading
core/java/com/android/internal/app/ResolverActivity.java +11 −0 Original line number Diff line number Diff line Loading @@ -931,6 +931,11 @@ public class ResolverActivity extends Activity { return null; } @Override public CharSequence getBadgeContentDescription() { return null; } @Override public TargetInfo cloneFilledIn(Intent fillInIntent, int flags) { return new DisplayResolveInfo(this, fillInIntent, flags); Loading Loading @@ -1071,6 +1076,11 @@ public class ResolverActivity extends Activity { */ public Drawable getBadgeIcon(); /** * @return The content description for the badge icon */ public CharSequence getBadgeContentDescription(); /** * Clone this target with the given fill-in information. */ Loading Loading @@ -1542,6 +1552,7 @@ public class ResolverActivity extends Activity { final Drawable badge = info.getBadgeIcon(); if (badge != null) { holder.badge.setImageDrawable(badge); holder.badge.setContentDescription(info.getBadgeContentDescription()); holder.badge.setVisibility(View.VISIBLE); } else { holder.badge.setVisibility(View.GONE); Loading