diff options
-rw-r--r-- | api/current.txt | 12 | ||||
-rw-r--r-- | core/java/android/app/ApplicationPackageManager.java | 33 | ||||
-rw-r--r-- | core/java/android/content/pm/ComponentInfo.java | 18 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageItemInfo.java | 52 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageManager.java | 78 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageParser.java | 43 | ||||
-rw-r--r-- | core/res/res/values/attrs_manifest.xml | 26 | ||||
-rw-r--r-- | core/res/res/values/public.xml | 6 | ||||
-rw-r--r-- | test-runner/src/android/test/mock/MockPackageManager.java | 21 |
9 files changed, 268 insertions, 21 deletions
diff --git a/api/current.txt b/api/current.txt index 5a378e2..391cb9b 100644 --- a/api/current.txt +++ b/api/current.txt @@ -311,6 +311,7 @@ package android { field public static final int backgroundSplit = 16843659; // 0x101038b field public static final int backgroundStacked = 16843658; // 0x101038a field public static final int backupAgent = 16843391; // 0x101027f + field public static final int banner = 16843762; // 0x10103f2 field public static final int baseline = 16843548; // 0x101031c field public static final int baselineAlignBottom = 16843042; // 0x1010122 field public static final int baselineAligned = 16843046; // 0x1010126 @@ -7079,6 +7080,7 @@ package android.content.pm { ctor public ComponentInfo(); ctor public ComponentInfo(android.content.pm.ComponentInfo); ctor protected ComponentInfo(android.os.Parcel); + method public final int getBannerResource(); method public final int getIconResource(); method public final int getLogoResource(); method public boolean isEnabled(); @@ -7182,11 +7184,13 @@ package android.content.pm { ctor protected PackageItemInfo(android.os.Parcel); method protected void dumpBack(android.util.Printer, java.lang.String); method protected void dumpFront(android.util.Printer, java.lang.String); + method public android.graphics.drawable.Drawable loadBanner(android.content.pm.PackageManager); method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager); method public java.lang.CharSequence loadLabel(android.content.pm.PackageManager); method public android.graphics.drawable.Drawable loadLogo(android.content.pm.PackageManager); method public android.content.res.XmlResourceParser loadXmlMetaData(android.content.pm.PackageManager, java.lang.String); method public void writeToParcel(android.os.Parcel, int); + field public int banner; field public int icon; field public int labelRes; field public int logo; @@ -7214,12 +7218,16 @@ package android.content.pm { method public abstract void clearPackagePreferredActivities(java.lang.String); method public abstract java.lang.String[] currentToCanonicalPackageNames(java.lang.String[]); method public abstract void extendVerificationTimeout(int, int, long); + method public abstract android.graphics.drawable.Drawable getActivityBanner(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException; + method public abstract android.graphics.drawable.Drawable getActivityBanner(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract android.graphics.drawable.Drawable getActivityIcon(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract android.graphics.drawable.Drawable getActivityIcon(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract android.content.pm.ActivityInfo getActivityInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract android.graphics.drawable.Drawable getActivityLogo(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract android.graphics.drawable.Drawable getActivityLogo(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract java.util.List<android.content.pm.PermissionGroupInfo> getAllPermissionGroups(int); + method public abstract android.graphics.drawable.Drawable getApplicationBanner(android.content.pm.ApplicationInfo); + method public abstract android.graphics.drawable.Drawable getApplicationBanner(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract int getApplicationEnabledSetting(java.lang.String); method public abstract android.graphics.drawable.Drawable getApplicationIcon(android.content.pm.ApplicationInfo); method public abstract android.graphics.drawable.Drawable getApplicationIcon(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException; @@ -24069,12 +24077,16 @@ package android.test.mock { method public void clearPackagePreferredActivities(java.lang.String); method public java.lang.String[] currentToCanonicalPackageNames(java.lang.String[]); method public void extendVerificationTimeout(int, int, long); + method public android.graphics.drawable.Drawable getActivityBanner(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException; + method public android.graphics.drawable.Drawable getActivityBanner(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException; method public android.graphics.drawable.Drawable getActivityIcon(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException; method public android.graphics.drawable.Drawable getActivityIcon(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException; method public android.content.pm.ActivityInfo getActivityInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException; method public android.graphics.drawable.Drawable getActivityLogo(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException; method public android.graphics.drawable.Drawable getActivityLogo(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException; method public java.util.List<android.content.pm.PermissionGroupInfo> getAllPermissionGroups(int); + method public android.graphics.drawable.Drawable getApplicationBanner(android.content.pm.ApplicationInfo); + method public android.graphics.drawable.Drawable getApplicationBanner(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException; method public int getApplicationEnabledSetting(java.lang.String); method public android.graphics.drawable.Drawable getApplicationIcon(android.content.pm.ApplicationInfo); method public android.graphics.drawable.Drawable getApplicationIcon(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException; diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java index b505d4f..6f53df4 100644 --- a/core/java/android/app/ApplicationPackageManager.java +++ b/core/java/android/app/ApplicationPackageManager.java @@ -729,6 +729,39 @@ final class ApplicationPackageManager extends PackageManager { } @Override + public Drawable getActivityBanner(ComponentName activityName) + throws NameNotFoundException { + return getActivityInfo(activityName, 0).loadBanner(this); + } + + @Override + public Drawable getActivityBanner(Intent intent) + throws NameNotFoundException { + if (intent.getComponent() != null) { + return getActivityBanner(intent.getComponent()); + } + + ResolveInfo info = resolveActivity( + intent, PackageManager.MATCH_DEFAULT_ONLY); + if (info != null) { + return info.activityInfo.loadBanner(this); + } + + throw new NameNotFoundException(intent.toUri(0)); + } + + @Override + public Drawable getApplicationBanner(ApplicationInfo info) { + return info.loadBanner(this); + } + + @Override + public Drawable getApplicationBanner(String packageName) + throws NameNotFoundException { + return getApplicationBanner(getApplicationInfo(packageName, 0)); + } + + @Override public Drawable getActivityLogo(ComponentName activityName) throws NameNotFoundException { return getActivityInfo(activityName, 0).loadLogo(this); diff --git a/core/java/android/content/pm/ComponentInfo.java b/core/java/android/content/pm/ComponentInfo.java index 4dbcf23..7e8f285 100644 --- a/core/java/android/content/pm/ComponentInfo.java +++ b/core/java/android/content/pm/ComponentInfo.java @@ -128,6 +128,17 @@ public class ComponentInfo extends PackageItemInfo { return logo != 0 ? logo : applicationInfo.logo; } + /** + * Return the banner resource identifier to use for this component. If the + * component defines a banner, that is used; else, the application banner is + * used. + * + * @return The banner associated with this component. + */ + public final int getBannerResource() { + return banner != 0 ? banner : applicationInfo.banner; + } + protected void dumpFront(Printer pw, String prefix) { super.dumpFront(pw, prefix); pw.println(prefix + "enabled=" + enabled + " exported=" + exported @@ -175,6 +186,13 @@ public class ComponentInfo extends PackageItemInfo { /** * @hide */ + @Override protected Drawable loadDefaultBanner(PackageManager pm) { + return applicationInfo.loadBanner(pm); + } + + /** + * @hide + */ @Override protected Drawable loadDefaultLogo(PackageManager pm) { return applicationInfo.loadLogo(pm); diff --git a/core/java/android/content/pm/PackageItemInfo.java b/core/java/android/content/pm/PackageItemInfo.java index a67326e..58f1c84 100644 --- a/core/java/android/content/pm/PackageItemInfo.java +++ b/core/java/android/content/pm/PackageItemInfo.java @@ -68,6 +68,12 @@ public class PackageItemInfo { /** * A drawable resource identifier (in the package's resources) of this + * component's banner. From the "banner" attribute or, if not set, 0. + */ + public int banner; + + /** + * A drawable resource identifier (in the package's resources) of this * component's logo. Logos may be larger/wider than icons and are * displayed by certain UI elements in place of a name or name/icon * combination. From the "logo" attribute or, if not set, 0. @@ -92,6 +98,7 @@ public class PackageItemInfo { nonLocalizedLabel = orig.nonLocalizedLabel; if (nonLocalizedLabel != null) nonLocalizedLabel = nonLocalizedLabel.toString().trim(); icon = orig.icon; + banner = orig.banner; logo = orig.logo; metaData = orig.metaData; } @@ -146,6 +153,27 @@ public class PackageItemInfo { } /** + * Retrieve the current graphical banner associated with this item. This + * will call back on the given PackageManager to load the banner from + * the application. + * + * @param pm A PackageManager from which the banner can be loaded; usually + * the PackageManager from which you originally retrieved this item. + * + * @return Returns a Drawable containing the item's banner. If the item + * does not have a banner, this method will return null. + */ + public Drawable loadBanner(PackageManager pm) { + if (banner != 0) { + Drawable dr = pm.getDrawable(packageName, banner, getApplicationInfo()); + if (dr != null) { + return dr; + } + } + return loadDefaultBanner(pm); + } + + /** * Retrieve the default graphical icon associated with this item. * * @param pm A PackageManager from which the icon can be loaded; usually @@ -159,7 +187,22 @@ public class PackageItemInfo { protected Drawable loadDefaultIcon(PackageManager pm) { return pm.getDefaultActivityIcon(); } - + + /** + * Retrieve the default graphical banner associated with this item. + * + * @param pm A PackageManager from which the banner can be loaded; usually + * the PackageManager from which you originally retrieved this item. + * + * @return Returns a Drawable containing the item's default banner + * or null if no default logo is available. + * + * @hide + */ + protected Drawable loadDefaultBanner(PackageManager pm) { + return null; + } + /** * Retrieve the current graphical logo associated with this item. This * will call back on the given PackageManager to load the logo from @@ -224,10 +267,11 @@ public class PackageItemInfo { pw.println(prefix + "name=" + name); } pw.println(prefix + "packageName=" + packageName); - if (labelRes != 0 || nonLocalizedLabel != null || icon != 0) { + if (labelRes != 0 || nonLocalizedLabel != null || icon != 0 || banner != 0) { pw.println(prefix + "labelRes=0x" + Integer.toHexString(labelRes) + " nonLocalizedLabel=" + nonLocalizedLabel - + " icon=0x" + Integer.toHexString(icon)); + + " icon=0x" + Integer.toHexString(icon) + + " banner=0x" + Integer.toHexString(banner)); } } @@ -243,6 +287,7 @@ public class PackageItemInfo { dest.writeInt(icon); dest.writeInt(logo); dest.writeBundle(metaData); + dest.writeInt(banner); } protected PackageItemInfo(Parcel source) { @@ -254,6 +299,7 @@ public class PackageItemInfo { icon = source.readInt(); logo = source.readInt(); metaData = source.readBundle(); + banner = source.readInt(); } /** diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index ddf0ed6..6440f0b 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -2392,9 +2392,43 @@ public abstract class PackageManager { throws NameNotFoundException; /** + * Retrieve the banner associated with an activity. Given the full name of + * an activity, retrieves the information about it and calls + * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its + * banner. If the activity cannot be found, NameNotFoundException is thrown. + * + * @param activityName Name of the activity whose banner is to be retrieved. + * @return Returns the image of the banner, or null if the activity has no + * banner specified. + * @throws NameNotFoundException Thrown if the resources for the given + * activity could not be loaded. + * @see #getActivityBanner(Intent) + */ + public abstract Drawable getActivityBanner(ComponentName activityName) + throws NameNotFoundException; + + /** + * Retrieve the banner associated with an Intent. If intent.getClassName() + * is set, this simply returns the result of + * getActivityBanner(intent.getClassName()). Otherwise it resolves the + * intent's component and returns the banner associated with the resolved + * component. If intent.getClassName() cannot be found or the Intent cannot + * be resolved to a component, NameNotFoundException is thrown. + * + * @param intent The intent for which you would like to retrieve a banner. + * @return Returns the image of the banner, or null if the activity has no + * banner specified. + * @throws NameNotFoundException Thrown if the resources for application + * matching the given intent could not be loaded. + * @see #getActivityBanner(ComponentName) + */ + public abstract Drawable getActivityBanner(Intent intent) + throws NameNotFoundException; + + /** * Return the generic icon for an activity that is used when no specific * icon is defined. - * + * * @return Drawable Image of the icon. */ public abstract Drawable getDefaultActivityIcon(); @@ -2432,19 +2466,43 @@ public abstract class PackageManager { throws NameNotFoundException; /** - * Retrieve the logo associated with an activity. Given the full name of - * an activity, retrieves the information about it and calls - * {@link ComponentInfo#loadLogo ComponentInfo.loadLogo()} to return its logo. - * If the activity cannot be found, NameNotFoundException is thrown. + * Retrieve the banner associated with an application. * - * @param activityName Name of the activity whose logo is to be retrieved. - * - * @return Returns the image of the logo or null if the activity has no - * logo specified. + * @param info Information about application being queried. + * @return Returns the image of the banner or null if the application has no + * banner specified. + * @see #getApplicationBanner(String) + */ + public abstract Drawable getApplicationBanner(ApplicationInfo info); + + /** + * Retrieve the banner associated with an application. Given the name of the + * application's package, retrieves the information about it and calls + * getApplicationIcon() to return its banner. If the application cannot be + * found, NameNotFoundException is thrown. * + * @param packageName Name of the package whose application banner is to be + * retrieved. + * @return Returns the image of the banner or null if the application has no + * banner specified. * @throws NameNotFoundException Thrown if the resources for the given - * activity could not be loaded. + * application could not be loaded. + * @see #getApplicationBanner(ApplicationInfo) + */ + public abstract Drawable getApplicationBanner(String packageName) + throws NameNotFoundException; + + /** + * Retrieve the logo associated with an activity. Given the full name of an + * activity, retrieves the information about it and calls + * {@link ComponentInfo#loadLogo ComponentInfo.loadLogo()} to return its + * logo. If the activity cannot be found, NameNotFoundException is thrown. * + * @param activityName Name of the activity whose logo is to be retrieved. + * @return Returns the image of the logo or null if the activity has no logo + * specified. + * @throws NameNotFoundException Thrown if the resources for the given + * activity could not be loaded. * @see #getActivityLogo(Intent) */ public abstract Drawable getActivityLogo(ComponentName activityName) diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 4607902..4f1983e 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -167,18 +167,20 @@ public class PackageParser { final int labelRes; final int iconRes; final int logoRes; + final int bannerRes; String tag; TypedArray sa; ParsePackageItemArgs(Package _owner, String[] _outError, - int _nameRes, int _labelRes, int _iconRes, int _logoRes) { + int _nameRes, int _labelRes, int _iconRes, int _logoRes, int _bannerRes) { owner = _owner; outError = _outError; nameRes = _nameRes; labelRes = _labelRes; iconRes = _iconRes; logoRes = _logoRes; + bannerRes = _bannerRes; } } @@ -190,10 +192,10 @@ public class PackageParser { int flags; ParseComponentArgs(Package _owner, String[] _outError, - int _nameRes, int _labelRes, int _iconRes, int _logoRes, + int _nameRes, int _labelRes, int _iconRes, int _logoRes, int _bannerRes, String[] _sepProcesses, int _processRes, int _descriptionRes, int _enabledRes) { - super(_owner, _outError, _nameRes, _labelRes, _iconRes, _logoRes); + super(_owner, _outError, _nameRes, _labelRes, _iconRes, _logoRes, _bannerRes); sepProcesses = _sepProcesses; processRes = _processRes; descriptionRes = _descriptionRes; @@ -1656,7 +1658,8 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestPermissionGroup_name, com.android.internal.R.styleable.AndroidManifestPermissionGroup_label, com.android.internal.R.styleable.AndroidManifestPermissionGroup_icon, - com.android.internal.R.styleable.AndroidManifestPermissionGroup_logo)) { + com.android.internal.R.styleable.AndroidManifestPermissionGroup_logo, + com.android.internal.R.styleable.AndroidManifestPermissionGroup_banner)) { sa.recycle(); mParseError = PackageManager.INSTALL_PARSE_FAILED_MANIFEST_MALFORMED; return null; @@ -1699,7 +1702,8 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestPermission_name, com.android.internal.R.styleable.AndroidManifestPermission_label, com.android.internal.R.styleable.AndroidManifestPermission_icon, - com.android.internal.R.styleable.AndroidManifestPermission_logo)) { + com.android.internal.R.styleable.AndroidManifestPermission_logo, + com.android.internal.R.styleable.AndroidManifestPermission_banner)) { sa.recycle(); mParseError = PackageManager.INSTALL_PARSE_FAILED_MANIFEST_MALFORMED; return null; @@ -1768,7 +1772,8 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestPermissionTree_name, com.android.internal.R.styleable.AndroidManifestPermissionTree_label, com.android.internal.R.styleable.AndroidManifestPermissionTree_icon, - com.android.internal.R.styleable.AndroidManifestPermissionTree_logo)) { + com.android.internal.R.styleable.AndroidManifestPermissionTree_logo, + com.android.internal.R.styleable.AndroidManifestPermissionTree_banner)) { sa.recycle(); mParseError = PackageManager.INSTALL_PARSE_FAILED_MANIFEST_MALFORMED; return null; @@ -1813,7 +1818,8 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestInstrumentation_name, com.android.internal.R.styleable.AndroidManifestInstrumentation_label, com.android.internal.R.styleable.AndroidManifestInstrumentation_icon, - com.android.internal.R.styleable.AndroidManifestInstrumentation_logo); + com.android.internal.R.styleable.AndroidManifestInstrumentation_logo, + com.android.internal.R.styleable.AndroidManifestInstrumentation_banner); mParseInstrumentationArgs.tag = "<instrumentation>"; } @@ -1929,6 +1935,8 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestApplication_icon, 0); ai.logo = sa.getResourceId( com.android.internal.R.styleable.AndroidManifestApplication_logo, 0); + ai.banner = sa.getResourceId( + com.android.internal.R.styleable.AndroidManifestApplication_banner, 0); ai.theme = sa.getResourceId( com.android.internal.R.styleable.AndroidManifestApplication_theme, 0); ai.descriptionRes = sa.getResourceId( @@ -2222,7 +2230,7 @@ public class PackageParser { private boolean parsePackageItemInfo(Package owner, PackageItemInfo outInfo, String[] outError, String tag, TypedArray sa, - int nameRes, int labelRes, int iconRes, int logoRes) { + int nameRes, int labelRes, int iconRes, int logoRes, int bannerRes) { String name = sa.getNonConfigurationString(nameRes, 0); if (name == null) { outError[0] = tag + " does not specify android:name"; @@ -2246,6 +2254,11 @@ public class PackageParser { outInfo.logo = logoVal; } + int bannerVal = sa.getResourceId(bannerRes, 0); + if (bannerVal != 0) { + outInfo.banner = bannerVal; + } + TypedValue v = sa.peekValue(labelRes); if (v != null && (outInfo.labelRes=v.resourceId) == 0) { outInfo.nonLocalizedLabel = v.coerceToString(); @@ -2269,6 +2282,7 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestActivity_label, com.android.internal.R.styleable.AndroidManifestActivity_icon, com.android.internal.R.styleable.AndroidManifestActivity_logo, + com.android.internal.R.styleable.AndroidManifestActivity_banner, mSeparateProcesses, com.android.internal.R.styleable.AndroidManifestActivity_process, com.android.internal.R.styleable.AndroidManifestActivity_description, @@ -2554,6 +2568,7 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestActivityAlias_label, com.android.internal.R.styleable.AndroidManifestActivityAlias_icon, com.android.internal.R.styleable.AndroidManifestActivityAlias_logo, + com.android.internal.R.styleable.AndroidManifestActivityAlias_banner, mSeparateProcesses, 0, com.android.internal.R.styleable.AndroidManifestActivityAlias_description, @@ -2588,6 +2603,7 @@ public class PackageParser { info.flags = target.info.flags; info.icon = target.info.icon; info.logo = target.info.logo; + info.banner = target.info.banner; info.labelRes = target.info.labelRes; info.nonLocalizedLabel = target.info.nonLocalizedLabel; info.launchMode = target.info.launchMode; @@ -2701,6 +2717,7 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestProvider_label, com.android.internal.R.styleable.AndroidManifestProvider_icon, com.android.internal.R.styleable.AndroidManifestProvider_logo, + com.android.internal.R.styleable.AndroidManifestProvider_banner, mSeparateProcesses, com.android.internal.R.styleable.AndroidManifestProvider_process, com.android.internal.R.styleable.AndroidManifestProvider_description, @@ -3007,6 +3024,7 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestService_label, com.android.internal.R.styleable.AndroidManifestService_icon, com.android.internal.R.styleable.AndroidManifestService_logo, + com.android.internal.R.styleable.AndroidManifestService_banner, mSeparateProcesses, com.android.internal.R.styleable.AndroidManifestService_process, com.android.internal.R.styleable.AndroidManifestService_description, @@ -3304,6 +3322,9 @@ public class PackageParser { outInfo.logo = sa.getResourceId( com.android.internal.R.styleable.AndroidManifestIntentFilter_logo, 0); + outInfo.banner = sa.getResourceId( + com.android.internal.R.styleable.AndroidManifestIntentFilter_banner, 0); + sa.recycle(); int outerDepth = parser.getDepth(); @@ -3666,6 +3687,11 @@ public class PackageParser { outInfo.logo = logoVal; } + int bannerVal = args.sa.getResourceId(args.bannerRes, 0); + if (bannerVal != 0) { + outInfo.banner = bannerVal; + } + TypedValue v = args.sa.peekValue(args.labelRes); if (v != null && (outInfo.labelRes=v.resourceId) == 0) { outInfo.nonLocalizedLabel = v.coerceToString(); @@ -4090,6 +4116,7 @@ public class PackageParser { public CharSequence nonLocalizedLabel; public int icon; public int logo; + public int banner; public int preferred; } diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index b20f5ba..cbde41c 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -62,6 +62,21 @@ a reference to a Drawable resource containing the image definition. --> <attr name="icon" format="reference" /> + <!-- A Drawable resource providing an extended graphical banner for its + associated item. Use with the application tag (to supply a default + banner for all application activities), or with the activity, tag to + supply a banner for a specific activity. + + <p>The given banner will be used to display to the user a graphical + representation of an activity in the Leanback application launcher. + Since banners are displayed only in the Leanback launcher, they should + only be used with activities (and applications) that support Leanback + mode. These are activities that handle Intents of category + {@link android.content.Intent#CATEGORY_LEANBACK_LAUNCHER + Intent.CATEGORY_LEANBACK_LAUNCHER}. + <p>This must be a reference to a Drawable resource containing the image definition. --> + <attr name="banner" format="reference" /> + <!-- A Drawable resource providing an extended graphical logo for its associated item. Use with the application tag (to supply a default logo for all application components), or with the activity, receiver, @@ -888,6 +903,7 @@ <attr name="theme" /> <attr name="label" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="description" /> <attr name="permission" /> @@ -970,6 +986,7 @@ <attr name="name" /> <attr name="label" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="permissionGroup" /> <attr name="description" /> @@ -996,6 +1013,7 @@ <attr name="name" /> <attr name="label" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="description" /> <attr name="permissionGroupFlags" /> @@ -1028,6 +1046,7 @@ <attr name="name" /> <attr name="label" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> </declare-styleable> @@ -1294,6 +1313,7 @@ <attr name="label" /> <attr name="description" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="process" /> <attr name="authorities" /> @@ -1375,6 +1395,7 @@ <attr name="label" /> <attr name="description" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="permission" /> <attr name="process" /> @@ -1417,6 +1438,7 @@ <attr name="label" /> <attr name="description" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="permission" /> <attr name="process" /> @@ -1451,6 +1473,7 @@ <attr name="label" /> <attr name="description" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="launchMode" /> <attr name="screenOrientation" /> @@ -1514,6 +1537,7 @@ <attr name="label" /> <attr name="description" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="permission" /> <!-- Specify whether the activity-alias is enabled or not (that is, can be instantiated by the system). @@ -1585,6 +1609,7 @@ parent="AndroidManifestActivity AndroidManifestReceiver AndroidManifestService"> <attr name="label" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="priority" /> </declare-styleable> @@ -1713,6 +1738,7 @@ <attr name="targetPackage" /> <attr name="label" /> <attr name="icon" /> + <attr name="banner" /> <attr name="logo" /> <attr name="handleProfiling" /> <attr name="functionalTest" /> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 8187939..5e3cbe6 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2087,4 +2087,10 @@ <public type="style" name="Theme.DeviceDefault.NoActionBar.TranslucentDecor" id="0x010301e3" /> <public type="style" name="Theme.DeviceDefault.Light.NoActionBar.TranslucentDecor" id="0x010301e4" /> +<!-- =============================================================== + Resources added in version 20 of the platform + =============================================================== --> + <eat-comment /> + + <public type="attr" name="banner" id="0x10103f2" /> </resources> diff --git a/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/src/android/test/mock/MockPackageManager.java index 661bd41..c1305bc 100644 --- a/test-runner/src/android/test/mock/MockPackageManager.java +++ b/test-runner/src/android/test/mock/MockPackageManager.java @@ -338,6 +338,27 @@ public class MockPackageManager extends PackageManager { } @Override + public Drawable getActivityBanner(ComponentName activityName) + throws NameNotFoundException { + throw new UnsupportedOperationException(); + } + + @Override + public Drawable getActivityBanner(Intent intent) throws NameNotFoundException { + throw new UnsupportedOperationException(); + } + + @Override + public Drawable getApplicationBanner(ApplicationInfo info) { + throw new UnsupportedOperationException(); + } + + @Override + public Drawable getApplicationBanner(String packageName) throws NameNotFoundException { + throw new UnsupportedOperationException(); + } + + @Override public Drawable getApplicationIcon(ApplicationInfo info) { throw new UnsupportedOperationException(); } |