Merge "Add test runner log when test case class is not loaded."
diff --git a/api/current.xml b/api/current.xml
index 1a4d993..97f3285 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -2136,7 +2136,7 @@
type="int"
transient="false"
volatile="false"
- value="16843454"
+ value="16843521"
static="true"
final="true"
deprecated="not deprecated"
@@ -2356,7 +2356,7 @@
type="int"
transient="false"
volatile="false"
- value="16843460"
+ value="16843527"
static="true"
final="true"
deprecated="not deprecated"
@@ -3027,7 +3027,7 @@
type="int"
transient="false"
volatile="false"
- value="16843463"
+ value="16843530"
static="true"
final="true"
deprecated="not deprecated"
@@ -4204,7 +4204,7 @@
type="int"
transient="false"
volatile="false"
- value="16843458"
+ value="16843525"
static="true"
final="true"
deprecated="not deprecated"
@@ -4237,7 +4237,7 @@
type="int"
transient="false"
volatile="false"
- value="16843461"
+ value="16843528"
static="true"
final="true"
deprecated="not deprecated"
@@ -5861,6 +5861,50 @@
visibility="public"
>
</field>
+<field name="kraken_resource_pad56"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843465"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="kraken_resource_pad57"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843464"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="kraken_resource_pad58"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843463"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="kraken_resource_pad59"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843462"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="kraken_resource_pad6"
type="int"
transient="false"
@@ -5872,6 +5916,83 @@
visibility="public"
>
</field>
+<field name="kraken_resource_pad60"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843461"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="kraken_resource_pad61"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843460"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="kraken_resource_pad62"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843459"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="kraken_resource_pad63"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843458"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="kraken_resource_pad64"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843457"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="kraken_resource_pad65"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843456"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="kraken_resource_pad66"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843455"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="kraken_resource_pad7"
type="int"
transient="false"
@@ -6455,6 +6576,17 @@
visibility="public"
>
</field>
+<field name="logo"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843454"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="longClickable"
type="int"
transient="false"
@@ -8241,7 +8373,7 @@
type="int"
transient="false"
volatile="false"
- value="16843455"
+ value="16843522"
static="true"
final="true"
deprecated="not deprecated"
@@ -8439,7 +8571,7 @@
type="int"
transient="false"
volatile="false"
- value="16843456"
+ value="16843523"
static="true"
final="true"
deprecated="not deprecated"
@@ -9638,7 +9770,7 @@
type="int"
transient="false"
volatile="false"
- value="16843459"
+ value="16843526"
static="true"
final="true"
deprecated="not deprecated"
@@ -9671,7 +9803,7 @@
type="int"
transient="false"
volatile="false"
- value="16843462"
+ value="16843529"
static="true"
final="true"
deprecated="not deprecated"
@@ -9858,7 +9990,7 @@
type="int"
transient="false"
volatile="false"
- value="16843457"
+ value="16843524"
static="true"
final="true"
deprecated="not deprecated"
@@ -10419,7 +10551,7 @@
type="int"
transient="false"
volatile="false"
- value="16843465"
+ value="16843532"
static="true"
final="true"
deprecated="not deprecated"
@@ -10430,7 +10562,7 @@
type="int"
transient="false"
volatile="false"
- value="16843464"
+ value="16843531"
static="true"
final="true"
deprecated="not deprecated"
@@ -47848,6 +47980,19 @@
<parameter name="pm" type="android.content.pm.PackageManager">
</parameter>
</method>
+<method name="loadLogo"
+ return="android.graphics.drawable.Drawable"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="pm" type="android.content.pm.PackageManager">
+</parameter>
+</method>
<method name="loadXmlMetaData"
return="android.content.res.XmlResourceParser"
abstract="false"
@@ -47898,6 +48043,16 @@
visibility="public"
>
</field>
+<field name="logo"
+ type="int"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="metaData"
type="android.os.Bundle"
transient="false"
@@ -48180,6 +48335,36 @@
<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
</exception>
</method>
+<method name="getActivityLogo"
+ return="android.graphics.drawable.Drawable"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="activityName" type="android.content.ComponentName">
+</parameter>
+<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
+</exception>
+</method>
+<method name="getActivityLogo"
+ return="android.graphics.drawable.Drawable"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="intent" type="android.content.Intent">
+</parameter>
+<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
+</exception>
+</method>
<method name="getAllPermissionGroups"
return="java.util.List<android.content.pm.PermissionGroupInfo>"
abstract="true"
@@ -48264,6 +48449,34 @@
<parameter name="info" type="android.content.pm.ApplicationInfo">
</parameter>
</method>
+<method name="getApplicationLogo"
+ return="android.graphics.drawable.Drawable"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="info" type="android.content.pm.ApplicationInfo">
+</parameter>
+</method>
+<method name="getApplicationLogo"
+ return="android.graphics.drawable.Drawable"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="packageName" type="java.lang.String">
+</parameter>
+<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
+</exception>
+</method>
<method name="getComponentEnabledSetting"
return="int"
abstract="true"
@@ -153121,6 +153334,36 @@
<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
</exception>
</method>
+<method name="getActivityLogo"
+ return="android.graphics.drawable.Drawable"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="activityName" type="android.content.ComponentName">
+</parameter>
+<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
+</exception>
+</method>
+<method name="getActivityLogo"
+ return="android.graphics.drawable.Drawable"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="intent" type="android.content.Intent">
+</parameter>
+<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
+</exception>
+</method>
<method name="getAllPermissionGroups"
return="java.util.List<android.content.pm.PermissionGroupInfo>"
abstract="false"
@@ -153205,6 +153448,34 @@
<parameter name="info" type="android.content.pm.ApplicationInfo">
</parameter>
</method>
+<method name="getApplicationLogo"
+ return="android.graphics.drawable.Drawable"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="info" type="android.content.pm.ApplicationInfo">
+</parameter>
+</method>
+<method name="getApplicationLogo"
+ return="android.graphics.drawable.Drawable"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="packageName" type="java.lang.String">
+</parameter>
+<exception name="PackageManager.NameNotFoundException" type="android.content.pm.PackageManager.NameNotFoundException">
+</exception>
+</method>
<method name="getComponentEnabledSetting"
return="int"
abstract="false"
@@ -158851,7 +159122,7 @@
>
<parameter name="text" type="java.lang.CharSequence">
</parameter>
-<parameter name="p" type="android.text.TextPaint">
+<parameter name="paint" type="android.text.TextPaint">
</parameter>
<parameter name="avail" type="float">
</parameter>
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index cf0597a..e646827 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -2173,6 +2173,39 @@
throws NameNotFoundException {
return getApplicationIcon(getApplicationInfo(packageName, 0));
}
+
+ @Override
+ public Drawable getActivityLogo(ComponentName activityName)
+ throws NameNotFoundException {
+ return getActivityInfo(activityName, 0).loadLogo(this);
+ }
+
+ @Override
+ public Drawable getActivityLogo(Intent intent)
+ throws NameNotFoundException {
+ if (intent.getComponent() != null) {
+ return getActivityLogo(intent.getComponent());
+ }
+
+ ResolveInfo info = resolveActivity(
+ intent, PackageManager.MATCH_DEFAULT_ONLY);
+ if (info != null) {
+ return info.activityInfo.loadLogo(this);
+ }
+
+ throw new NameNotFoundException(intent.toUri(0));
+ }
+
+ @Override
+ public Drawable getApplicationLogo(ApplicationInfo info) {
+ return info.loadLogo(this);
+ }
+
+ @Override
+ public Drawable getApplicationLogo(String packageName)
+ throws NameNotFoundException {
+ return getApplicationLogo(getApplicationInfo(packageName, 0));
+ }
@Override public Resources getResourcesForActivity(
ComponentName activityName) throws NameNotFoundException {
diff --git a/core/java/android/content/pm/ComponentInfo.java b/core/java/android/content/pm/ComponentInfo.java
index cafe372..f16c4ef 100644
--- a/core/java/android/content/pm/ComponentInfo.java
+++ b/core/java/android/content/pm/ComponentInfo.java
@@ -157,6 +157,14 @@
/**
* @hide
*/
+ @Override
+ protected Drawable loadDefaultLogo(PackageManager pm) {
+ return applicationInfo.loadLogo(pm);
+ }
+
+ /**
+ * @hide
+ */
@Override protected ApplicationInfo getApplicationInfo() {
return applicationInfo;
}
diff --git a/core/java/android/content/pm/PackageItemInfo.java b/core/java/android/content/pm/PackageItemInfo.java
index 14c06800..d73aaf6 100644
--- a/core/java/android/content/pm/PackageItemInfo.java
+++ b/core/java/android/content/pm/PackageItemInfo.java
@@ -67,6 +67,14 @@
public int icon;
/**
+ * 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.
+ */
+ public int logo;
+
+ /**
* Additional meta-data associated with this component. This field
* will only be filled in if you set the
* {@link PackageManager#GET_META_DATA} flag when requesting the info.
@@ -84,6 +92,7 @@
nonLocalizedLabel = orig.nonLocalizedLabel;
if (nonLocalizedLabel != null) nonLocalizedLabel = nonLocalizedLabel.toString().trim();
icon = orig.icon;
+ logo = orig.logo;
metaData = orig.metaData;
}
@@ -152,6 +161,42 @@
}
/**
+ * Retrieve the current graphical logo associated with this item. This
+ * will call back on the given PackageManager to load the logo from
+ * the application.
+ *
+ * @param pm A PackageManager from which the logo can be loaded; usually
+ * the PackageManager from which you originally retrieved this item.
+ *
+ * @return Returns a Drawable containing the item's logo. If the item
+ * does not have a logo, this method will return null.
+ */
+ public Drawable loadLogo(PackageManager pm) {
+ if (logo != 0) {
+ Drawable d = pm.getDrawable(packageName, logo, getApplicationInfo());
+ if (d != null) {
+ return d;
+ }
+ }
+ return loadDefaultLogo(pm);
+ }
+
+ /**
+ * Retrieve the default graphical logo associated with this item.
+ *
+ * @param pm A PackageManager from which the logo can be loaded; usually
+ * the PackageManager from which you originally retrieved this item.
+ *
+ * @return Returns a Drawable containing the item's default logo
+ * or null if no default logo is available.
+ *
+ * @hide
+ */
+ protected Drawable loadDefaultLogo(PackageManager pm) {
+ return null;
+ }
+
+ /**
* Load an XML resource attached to the meta-data of this item. This will
* retrieved the name meta-data entry, and if defined call back on the
* given PackageManager to load its XML file from the application.
@@ -196,6 +241,7 @@
dest.writeInt(labelRes);
TextUtils.writeToParcel(nonLocalizedLabel, dest, parcelableFlags);
dest.writeInt(icon);
+ dest.writeInt(logo);
dest.writeBundle(metaData);
}
@@ -206,6 +252,7 @@
nonLocalizedLabel
= TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
icon = source.readInt();
+ logo = source.readInt();
metaData = source.readBundle();
}
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 68b44e7..196f508 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -1597,6 +1597,79 @@
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 can not 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)
+ throws NameNotFoundException;
+
+ /**
+ * Retrieve the logo associated with an Intent. If intent.getClassName() is
+ * set, this simply returns the result of
+ * getActivityLogo(intent.getClassName()). Otherwise it resolves the intent's
+ * component and returns the logo associated with the resolved component.
+ * If intent.getClassName() can not be found or the Intent can not be resolved
+ * to a component, NameNotFoundException is thrown.
+ *
+ * @param intent The intent for which you would like to retrieve a logo.
+ *
+ * @return Returns the image of the logo, or null if the activity has no
+ * logo specified.
+ *
+ * @throws NameNotFoundException Thrown if the resources for application
+ * matching the given intent could not be loaded.
+ *
+ * @see #getActivityLogo(ComponentName)
+ */
+ public abstract Drawable getActivityLogo(Intent intent)
+ throws NameNotFoundException;
+
+ /**
+ * Retrieve the logo associated with an application. If it has not specified
+ * a logo, this method returns null.
+ *
+ * @param info Information about application being queried.
+ *
+ * @return Returns the image of the logo, or null if no logo is specified
+ * by the application.
+ *
+ * @see #getApplicationLogo(String)
+ */
+ public abstract Drawable getApplicationLogo(ApplicationInfo info);
+
+ /**
+ * Retrieve the logo associated with an application. Given the name of the
+ * application's package, retrieves the information about it and calls
+ * getApplicationLogo() to return its logo. If the application can not be
+ * found, NameNotFoundException is thrown.
+ *
+ * @param packageName Name of the package whose application logo is to be
+ * retrieved.
+ *
+ * @return Returns the image of the logo, or null if no application logo
+ * has been specified.
+ *
+ * @throws NameNotFoundException Thrown if the resources for the given
+ * application could not be loaded.
+ *
+ * @see #getApplicationLogo(ApplicationInfo)
+ */
+ public abstract Drawable getApplicationLogo(String packageName)
+ throws NameNotFoundException;
+
+ /**
* Retrieve text from a package. This is a low-level API used by
* the various package manager info structures (such as
* {@link ComponentInfo} to implement retrieval of their associated
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index f9e12ce..6a4fefc 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -105,17 +105,19 @@
final int nameRes;
final int labelRes;
final int iconRes;
+ final int logoRes;
String tag;
TypedArray sa;
ParsePackageItemArgs(Package _owner, String[] _outError,
- int _nameRes, int _labelRes, int _iconRes) {
+ int _nameRes, int _labelRes, int _iconRes, int _logoRes) {
owner = _owner;
outError = _outError;
nameRes = _nameRes;
labelRes = _labelRes;
iconRes = _iconRes;
+ logoRes = _logoRes;
}
}
@@ -127,10 +129,10 @@
int flags;
ParseComponentArgs(Package _owner, String[] _outError,
- int _nameRes, int _labelRes, int _iconRes,
+ int _nameRes, int _labelRes, int _iconRes, int _logoRes,
String[] _sepProcesses, int _processRes,
int _descriptionRes, int _enabledRes) {
- super(_owner, _outError, _nameRes, _labelRes, _iconRes);
+ super(_owner, _outError, _nameRes, _labelRes, _iconRes, _logoRes);
sepProcesses = _sepProcesses;
processRes = _processRes;
descriptionRes = _descriptionRes;
@@ -1241,7 +1243,8 @@
"<permission-group>", sa,
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_icon,
+ com.android.internal.R.styleable.AndroidManifestPermissionGroup_logo)) {
sa.recycle();
mParseError = PackageManager.INSTALL_PARSE_FAILED_MANIFEST_MALFORMED;
return null;
@@ -1276,7 +1279,8 @@
"<permission>", sa,
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_icon,
+ com.android.internal.R.styleable.AndroidManifestPermission_logo)) {
sa.recycle();
mParseError = PackageManager.INSTALL_PARSE_FAILED_MANIFEST_MALFORMED;
return null;
@@ -1329,7 +1333,8 @@
"<permission-tree>", sa,
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_icon,
+ com.android.internal.R.styleable.AndroidManifestPermissionTree_logo)) {
sa.recycle();
mParseError = PackageManager.INSTALL_PARSE_FAILED_MANIFEST_MALFORMED;
return null;
@@ -1373,7 +1378,8 @@
mParseInstrumentationArgs = new ParsePackageItemArgs(owner, outError,
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_icon,
+ com.android.internal.R.styleable.AndroidManifestInstrumentation_logo);
mParseInstrumentationArgs.tag = "<instrumentation>";
}
@@ -1485,6 +1491,8 @@
ai.icon = sa.getResourceId(
com.android.internal.R.styleable.AndroidManifestApplication_icon, 0);
+ ai.logo = sa.getResourceId(
+ com.android.internal.R.styleable.AndroidManifestApplication_logo, 0);
ai.theme = sa.getResourceId(
com.android.internal.R.styleable.AndroidManifestApplication_theme, 0);
ai.descriptionRes = sa.getResourceId(
@@ -1711,7 +1719,7 @@
private boolean parsePackageItemInfo(Package owner, PackageItemInfo outInfo,
String[] outError, String tag, TypedArray sa,
- int nameRes, int labelRes, int iconRes) {
+ int nameRes, int labelRes, int iconRes, int logoRes) {
String name = sa.getNonConfigurationString(nameRes, 0);
if (name == null) {
outError[0] = tag + " does not specify android:name";
@@ -1729,6 +1737,11 @@
outInfo.icon = iconVal;
outInfo.nonLocalizedLabel = null;
}
+
+ int logoVal = sa.getResourceId(logoRes, 0);
+ if (logoVal != 0) {
+ outInfo.logo = logoVal;
+ }
TypedValue v = sa.peekValue(labelRes);
if (v != null && (outInfo.labelRes=v.resourceId) == 0) {
@@ -1751,6 +1764,7 @@
com.android.internal.R.styleable.AndroidManifestActivity_name,
com.android.internal.R.styleable.AndroidManifestActivity_label,
com.android.internal.R.styleable.AndroidManifestActivity_icon,
+ com.android.internal.R.styleable.AndroidManifestActivity_logo,
mSeparateProcesses,
com.android.internal.R.styleable.AndroidManifestActivity_process,
com.android.internal.R.styleable.AndroidManifestActivity_description,
@@ -1953,6 +1967,7 @@
com.android.internal.R.styleable.AndroidManifestActivityAlias_name,
com.android.internal.R.styleable.AndroidManifestActivityAlias_label,
com.android.internal.R.styleable.AndroidManifestActivityAlias_icon,
+ com.android.internal.R.styleable.AndroidManifestActivityAlias_logo,
mSeparateProcesses,
0,
com.android.internal.R.styleable.AndroidManifestActivityAlias_description,
@@ -1986,6 +2001,7 @@
info.configChanges = target.info.configChanges;
info.flags = target.info.flags;
info.icon = target.info.icon;
+ info.logo = target.info.logo;
info.labelRes = target.info.labelRes;
info.nonLocalizedLabel = target.info.nonLocalizedLabel;
info.launchMode = target.info.launchMode;
@@ -2080,6 +2096,7 @@
com.android.internal.R.styleable.AndroidManifestProvider_name,
com.android.internal.R.styleable.AndroidManifestProvider_label,
com.android.internal.R.styleable.AndroidManifestProvider_icon,
+ com.android.internal.R.styleable.AndroidManifestProvider_logo,
mSeparateProcesses,
com.android.internal.R.styleable.AndroidManifestProvider_process,
com.android.internal.R.styleable.AndroidManifestProvider_description,
@@ -2343,6 +2360,7 @@
com.android.internal.R.styleable.AndroidManifestService_name,
com.android.internal.R.styleable.AndroidManifestService_label,
com.android.internal.R.styleable.AndroidManifestService_icon,
+ com.android.internal.R.styleable.AndroidManifestService_logo,
mSeparateProcesses,
com.android.internal.R.styleable.AndroidManifestService_process,
com.android.internal.R.styleable.AndroidManifestService_description,
@@ -2546,6 +2564,9 @@
outInfo.icon = sa.getResourceId(
com.android.internal.R.styleable.AndroidManifestIntentFilter_icon, 0);
+
+ outInfo.logo = sa.getResourceId(
+ com.android.internal.R.styleable.AndroidManifestIntentFilter_logo, 0);
sa.recycle();
@@ -2807,6 +2828,11 @@
outInfo.icon = iconVal;
outInfo.nonLocalizedLabel = null;
}
+
+ int logoVal = args.sa.getResourceId(args.logoRes, 0);
+ if (logoVal != 0) {
+ outInfo.logo = logoVal;
+ }
TypedValue v = args.sa.peekValue(args.labelRes);
if (v != null && (outInfo.labelRes=v.resourceId) == 0) {
@@ -3141,6 +3167,7 @@
public int labelRes;
public CharSequence nonLocalizedLabel;
public int icon;
+ public int logo;
}
public final static class ActivityIntentInfo extends IntentInfo {
diff --git a/core/java/android/net/http/Request.java b/core/java/android/net/http/Request.java
index f1ebb47..8c0d503 100644
--- a/core/java/android/net/http/Request.java
+++ b/core/java/android/net/http/Request.java
@@ -268,7 +268,10 @@
if (hasBody)
entity = httpClientConnection.receiveResponseEntity(header);
- boolean supportPartialContent = v.greaterEquals(HttpVersion.HTTP_1_1);
+ // restrict the range request to the servers claiming that they are
+ // accepting ranges in bytes
+ boolean supportPartialContent = "bytes".equalsIgnoreCase(header
+ .getAcceptRanges());
if (entity != null) {
InputStream is = entity.getContent();
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 3aeabd0..76dde76 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -2288,7 +2288,9 @@
protected int computeHorizontalScrollRange() {
if (mDrawHistory) {
return mHistoryWidth;
- } else if (mHorizontalScrollBarMode == SCROLLBAR_ALWAYSOFF) {
+ } else if (mHorizontalScrollBarMode == SCROLLBAR_ALWAYSOFF
+ && (mActualScale - mMinZoomScale <= MINIMUM_SCALE_INCREMENT)) {
+ // only honor the scrollbar mode when it is at minimum zoom level
return computeHorizontalScrollExtent();
} else {
// to avoid rounding error caused unnecessary scrollbar, use floor
@@ -2300,7 +2302,9 @@
protected int computeVerticalScrollRange() {
if (mDrawHistory) {
return mHistoryHeight;
- } else if (mVerticalScrollBarMode == SCROLLBAR_ALWAYSOFF) {
+ } else if (mVerticalScrollBarMode == SCROLLBAR_ALWAYSOFF
+ && (mActualScale - mMinZoomScale <= MINIMUM_SCALE_INCREMENT)) {
+ // only honor the scrollbar mode when it is at minimum zoom level
return computeVerticalScrollExtent();
} else {
// to avoid rounding error caused unnecessary scrollbar, use floor
@@ -4763,9 +4767,11 @@
invalidate();
break;
}
+
if (!mConfirmMove) {
break;
}
+
if (mPreventDefault == PREVENT_DEFAULT_MAYBE_YES
|| mPreventDefault == PREVENT_DEFAULT_NO_FROM_TOUCH_DOWN) {
// track mLastTouchTime as we may need to do fling at
@@ -4933,9 +4939,17 @@
if (mPreventDefault != PREVENT_DEFAULT_YES
&& (computeMaxScrollX() > 0
|| computeMaxScrollY() > 0)) {
- // UI takes control back, cancel WebCore touch
- cancelWebCoreTouchEvent(contentX, contentY,
- true);
+ // If the user has performed a very quick touch
+ // sequence it is possible that we may get here
+ // before WebCore has had a chance to process the events.
+ // In this case, any call to preventDefault in the
+ // JS touch handler will not have been executed yet.
+ // Hence we will see both the UI (now) and WebCore
+ // (when context switches) handling the event,
+ // regardless of whether the web developer actually
+ // doeses preventDefault in their touch handler. This
+ // is the nature of our asynchronous touch model.
+
// we will not rewrite drag code here, but we
// will try fling if it applies.
WebViewCore.reducePriority();
diff --git a/core/res/assets/images/combobox-disabled.png b/core/res/assets/images/combobox-disabled.png
deleted file mode 100644
index fe220e4..0000000
--- a/core/res/assets/images/combobox-disabled.png
+++ /dev/null
Binary files differ
diff --git a/core/res/assets/images/combobox-noHighlight.png b/core/res/assets/images/combobox-noHighlight.png
deleted file mode 100644
index abcdf72..0000000
--- a/core/res/assets/images/combobox-noHighlight.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/combobox_disabled.png b/core/res/res/drawable-hdpi/combobox_disabled.png
new file mode 100644
index 0000000..50eb45e
--- /dev/null
+++ b/core/res/res/drawable-hdpi/combobox_disabled.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/combobox_nohighlight.png b/core/res/res/drawable-hdpi/combobox_nohighlight.png
new file mode 100644
index 0000000..9d60301
--- /dev/null
+++ b/core/res/res/drawable-hdpi/combobox_nohighlight.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/combobox_disabled.png b/core/res/res/drawable-mdpi/combobox_disabled.png
new file mode 100644
index 0000000..c32db7e
--- /dev/null
+++ b/core/res/res/drawable-mdpi/combobox_disabled.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/combobox_nohighlight.png b/core/res/res/drawable-mdpi/combobox_nohighlight.png
new file mode 100644
index 0000000..1963316
--- /dev/null
+++ b/core/res/res/drawable-mdpi/combobox_nohighlight.png
Binary files differ
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index e8df2b6..f98445c 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -62,6 +62,22 @@
a reference to a Drawable resource containing the image definition. -->
<attr name="icon" 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,
+ service, or instrumentation tag (to supply a specific logo for that
+ component). It may also be used with the intent-filter tag to supply
+ a logo to show to the user when an activity is being selected based
+ on a particular Intent.
+
+ <p>The given logo will be used to display to the user a graphical
+ representation of its associated component; for example as the
+ header in the Action Bar. The primary differences between an icon
+ and a logo are that logos are often wider and more detailed, and are
+ used without an accompanying text caption. This must be a reference
+ to a Drawable resource containing the image definition. -->
+ <attr name="logo" format="reference" />
+
<!-- Name of the activity to be launched to manage application's space on
device. The specified activity gets automatically launched when the
application's space needs to be managed and is usually invoked
@@ -695,6 +711,7 @@
<attr name="theme" />
<attr name="label" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="description" />
<attr name="permission" />
<attr name="process" />
@@ -742,6 +759,7 @@
<attr name="name" />
<attr name="label" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="permissionGroup" />
<attr name="description" />
<attr name="protectionLevel" />
@@ -766,6 +784,7 @@
<attr name="name" />
<attr name="label" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="description" />
</declare-styleable>
@@ -795,6 +814,7 @@
<attr name="name" />
<attr name="label" />
<attr name="icon" />
+ <attr name="logo" />
</declare-styleable>
<!-- The <code>uses-permission</code> tag requests a
@@ -997,6 +1017,7 @@
<attr name="label" />
<attr name="description" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="process" />
<attr name="authorities" />
<attr name="syncable" />
@@ -1076,6 +1097,7 @@
<attr name="label" />
<attr name="description" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="permission" />
<attr name="process" />
<!-- Specify whether the service is enabled or not (that is, can be instantiated by the system).
@@ -1108,6 +1130,7 @@
<attr name="label" />
<attr name="description" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="permission" />
<attr name="process" />
<!-- Specify whether the receiver is enabled or not (that is, can be instantiated by the system).
@@ -1140,6 +1163,7 @@
<attr name="label" />
<attr name="description" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="launchMode" />
<attr name="screenOrientation" />
<attr name="configChanges" />
@@ -1193,6 +1217,7 @@
<attr name="label" />
<attr name="description" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="permission" />
<!-- Specify whether the activity-alias is enabled or not (that is, can be instantiated by the system).
It can also be specified for an application as a whole, in which case a value of "false"
@@ -1262,6 +1287,7 @@
parent="AndroidManifestActivity AndroidManifestReceiver AndroidManifestService">
<attr name="label" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="priority" />
</declare-styleable>
@@ -1368,6 +1394,7 @@
<attr name="targetPackage" />
<attr name="label" />
<attr name="icon" />
+ <attr name="logo" />
<attr name="handleProfiling" />
<attr name="functionalTest" />
</declare-styleable>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index f6e0519..03152b1 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1240,26 +1240,11 @@
<public type="anim" name="cycle_interpolator" id="0x010a000c" />
<!-- ===============================================================
- Resources proposed for Gingerbread.
- =============================================================== -->
- <eat-comment />
- <public type="attr" name="adapter" id="0x010102be" />
- <public type="attr" name="selection" id="0x010102bf" />
- <public type="attr" name="sortOrder" id="0x010102c0" />
- <public type="attr" name="uri" id="0x010102c1" />
- <public type="attr" name="from" id="0x010102c2" />
- <public type="attr" name="to" id="0x010102c3" />
- <public type="attr" name="as" id="0x010102c4" />
- <public type="attr" name="fromValue" id="0x010102c5" />
- <public type="attr" name="toValue" id="0x010102c6" />
- <public type="attr" name="column" id="0x010102c7" />
- <public type="attr" name="withExpression" id="0x010102c8" />
- <public type="attr" name="withClass" id="0x010102c9" />
-
-<!-- ===============================================================
Resources introduced in kraken.
=============================================================== -->
+ <public type="attr" name="logo" id="0x010102be" />
+
<public-padding type="attr" name="kraken_resource_pad" end="0x01010300" />
<public-padding type="id" name="kraken_resource_pad" end="0x01020040" />
<public-padding type="anim" name="kraken_resource_pad" end="0x010a0020" />
@@ -1272,4 +1257,21 @@
<public-padding type="color" name="kraken_resource_pad" end="0x01060020" />
<public-padding type="array" name="kraken_resource_pad" end="0x01070010" />
+<!-- ===============================================================
+ Resources proposed for Gingerbread.
+ =============================================================== -->
+ <eat-comment />
+ <public type="attr" name="adapter" />
+ <public type="attr" name="selection" />
+ <public type="attr" name="sortOrder" />
+ <public type="attr" name="uri" />
+ <public type="attr" name="from" />
+ <public type="attr" name="to" />
+ <public type="attr" name="as" />
+ <public type="attr" name="fromValue" />
+ <public type="attr" name="toValue" />
+ <public type="attr" name="column" />
+ <public type="attr" name="withExpression" />
+ <public type="attr" name="withClass" />
+
</resources>
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 97b96bc..d55d0a5 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -1751,10 +1751,17 @@
}
- private void cancelA2dpDeviceTimeout(String address) {
+ private void cancelA2dpDeviceTimeout() {
mAudioHandler.removeMessages(MSG_BTA2DP_DOCK_TIMEOUT);
}
+ private boolean hasScheduledA2dpDockTimeout() {
+ return mAudioHandler.hasMessages(MSG_BTA2DP_DOCK_TIMEOUT);
+ }
+
+ /* cache of the address of the last dock the device was connected to */
+ private String mDockAddress;
+
/**
* Receiver for misc intent broadcasts the Phone app cares about.
*/
@@ -1805,7 +1812,15 @@
state == BluetoothA2dp.STATE_PLAYING)) {
if (btDevice.isBluetoothDock()) {
// this could be a reconnection after a transient disconnection
- cancelA2dpDeviceTimeout(address);
+ cancelA2dpDeviceTimeout();
+ mDockAddress = address;
+ } else {
+ // this could be a connection of another A2DP device before the timeout of
+ // a dock: cancel the dock timeout, and make the dock unavailable now
+ if(hasScheduledA2dpDockTimeout()) {
+ cancelA2dpDeviceTimeout();
+ makeA2dpDeviceUnavailableNow(mDockAddress);
+ }
}
makeA2dpDeviceAvailable(address);
}
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 1501202..7a76fa0 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -1729,6 +1729,7 @@
static boolean comparePermissionInfos(PermissionInfo pi1, PermissionInfo pi2) {
if (pi1.icon != pi2.icon) return false;
+ if (pi1.logo != pi2.logo) return false;
if (pi1.protectionLevel != pi2.protectionLevel) return false;
if (!compareStrings(pi1.name, pi2.name)) return false;
if (!compareStrings(pi1.nonLocalizedLabel, pi2.nonLocalizedLabel)) return false;
@@ -8838,7 +8839,7 @@
}
String external = parser.getAttributeValue(null, "external");
if (external != null) {
- mInternalSdkPlatform = Integer.parseInt(external);
+ mExternalSdkPlatform = Integer.parseInt(external);
}
} catch (NumberFormatException e) {
}
@@ -9988,4 +9989,3 @@
android.provider.Settings.Secure.DEFAULT_INSTALL_LOCATION, PackageHelper.APP_INSTALL_AUTO);
}
}
-
diff --git a/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/src/android/test/mock/MockPackageManager.java
index 4964f03..3e77b9b 100644
--- a/test-runner/src/android/test/mock/MockPackageManager.java
+++ b/test-runner/src/android/test/mock/MockPackageManager.java
@@ -267,6 +267,26 @@
public Drawable getApplicationIcon(String packageName) throws NameNotFoundException {
throw new UnsupportedOperationException();
}
+
+ @Override
+ public Drawable getActivityLogo(ComponentName activityName) throws NameNotFoundException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Drawable getActivityLogo(Intent intent) throws NameNotFoundException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Drawable getApplicationLogo(ApplicationInfo info) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Drawable getApplicationLogo(String packageName) throws NameNotFoundException {
+ throw new UnsupportedOperationException();
+ }
@Override
public CharSequence getText(String packageName, int resid, ApplicationInfo appInfo) {