Merge "Fix issue #10560472: ApplicationInfo.manageSpaceActivity not parsed..." into klp-dev

This commit is contained in:
Dianne Hackborn
2013-09-06 21:31:29 +00:00
committed by Android (Google) Code Review
4 changed files with 69 additions and 26 deletions

View File

@@ -16,6 +16,7 @@
package android.content.pm;
import android.content.res.Configuration;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Printer;
@@ -437,20 +438,20 @@ public class ActivityInfo extends ComponentInfo
* native side given the bit we have assigned in ActivityInfo.
*/
public static int[] CONFIG_NATIVE_BITS = new int[] {
0x0001, // MNC
0x0002, // MCC
0x0004, // LOCALE
0x0008, // TOUCH SCREEN
0x0010, // KEYBOARD
0x0020, // KEYBOARD HIDDEN
0x0040, // NAVIGATION
0x0080, // ORIENTATION
0x0800, // SCREEN LAYOUT
0x1000, // UI MODE
0x0200, // SCREEN SIZE
0x2000, // SMALLEST SCREEN SIZE
0x0100, // DENSITY
0x4000, // LAYOUT DIRECTION
Configuration.NATIVE_CONFIG_MNC, // MNC
Configuration.NATIVE_CONFIG_MCC, // MCC
Configuration.NATIVE_CONFIG_LOCALE, // LOCALE
Configuration.NATIVE_CONFIG_TOUCHSCREEN, // TOUCH SCREEN
Configuration.NATIVE_CONFIG_KEYBOARD, // KEYBOARD
Configuration.NATIVE_CONFIG_KEYBOARD_HIDDEN, // KEYBOARD HIDDEN
Configuration.NATIVE_CONFIG_NAVIGATION, // NAVIGATION
Configuration.NATIVE_CONFIG_ORIENTATION, // ORIENTATION
Configuration.NATIVE_CONFIG_SCREEN_LAYOUT, // SCREEN LAYOUT
Configuration.NATIVE_CONFIG_UI_MODE, // UI MODE
Configuration.NATIVE_CONFIG_SCREEN_SIZE, // SCREEN SIZE
Configuration.NATIVE_CONFIG_SMALLEST_SCREEN_SIZE, // SMALLEST SCREEN SIZE
Configuration.NATIVE_CONFIG_DENSITY, // DENSITY
Configuration.NATIVE_CONFIG_LAYOUTDIR, // LAYOUT DIRECTION
};
/** @hide
* Convert Java change bits to native.

View File

@@ -1864,7 +1864,8 @@ public class PackageParser {
}
String manageSpaceActivity = sa.getNonConfigurationString(
com.android.internal.R.styleable.AndroidManifestApplication_manageSpaceActivity, 0);
com.android.internal.R.styleable.AndroidManifestApplication_manageSpaceActivity,
Configuration.NATIVE_CONFIG_VERSION);
if (manageSpaceActivity != null) {
ai.manageSpaceActivityName = buildClassName(pkgName, manageSpaceActivity,
outError);
@@ -1878,7 +1879,8 @@ public class PackageParser {
// backupAgent, killAfterRestore, and restoreAnyVersion are only relevant
// if backup is possible for the given application.
String backupAgent = sa.getNonConfigurationString(
com.android.internal.R.styleable.AndroidManifestApplication_backupAgent, 0);
com.android.internal.R.styleable.AndroidManifestApplication_backupAgent,
Configuration.NATIVE_CONFIG_VERSION);
if (backupAgent != null) {
ai.backupAgentName = buildClassName(pkgName, backupAgent, outError);
if (DEBUG_BACKUP) {
@@ -1999,7 +2001,8 @@ public class PackageParser {
if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.FROYO) {
str = sa.getNonConfigurationString(
com.android.internal.R.styleable.AndroidManifestApplication_taskAffinity, 0);
com.android.internal.R.styleable.AndroidManifestApplication_taskAffinity,
Configuration.NATIVE_CONFIG_VERSION);
} else {
// Some older apps have been seen to use a resource reference
// here that on older builds was ignored (with a warning). We
@@ -2014,7 +2017,8 @@ public class PackageParser {
CharSequence pname;
if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.FROYO) {
pname = sa.getNonConfigurationString(
com.android.internal.R.styleable.AndroidManifestApplication_process, 0);
com.android.internal.R.styleable.AndroidManifestApplication_process,
Configuration.NATIVE_CONFIG_VERSION);
} else {
// Some older apps have been seen to use a resource reference
// here that on older builds was ignored (with a warning). We
@@ -2278,7 +2282,8 @@ public class PackageParser {
a.info.applicationInfo.uiOptions);
String parentName = sa.getNonConfigurationString(
com.android.internal.R.styleable.AndroidManifestActivity_parentActivityName, 0);
com.android.internal.R.styleable.AndroidManifestActivity_parentActivityName,
Configuration.NATIVE_CONFIG_VERSION);
if (parentName != null) {
String parentClassName = buildClassName(a.info.packageName, parentName, outError);
if (outError[0] == null) {
@@ -2300,7 +2305,8 @@ public class PackageParser {
}
str = sa.getNonConfigurationString(
com.android.internal.R.styleable.AndroidManifestActivity_taskAffinity, 0);
com.android.internal.R.styleable.AndroidManifestActivity_taskAffinity,
Configuration.NATIVE_CONFIG_VERSION);
a.info.taskAffinity = buildTaskAffinityName(owner.applicationInfo.packageName,
owner.applicationInfo.taskAffinity, str, outError);
@@ -2509,7 +2515,8 @@ public class PackageParser {
com.android.internal.R.styleable.AndroidManifestActivityAlias);
String targetActivity = sa.getNonConfigurationString(
com.android.internal.R.styleable.AndroidManifestActivityAlias_targetActivity, 0);
com.android.internal.R.styleable.AndroidManifestActivityAlias_targetActivity,
Configuration.NATIVE_CONFIG_VERSION);
if (targetActivity == null) {
outError[0] = "<activity-alias> does not specify android:targetActivity";
sa.recycle();
@@ -2599,7 +2606,7 @@ public class PackageParser {
String parentName = sa.getNonConfigurationString(
com.android.internal.R.styleable.AndroidManifestActivityAlias_parentActivityName,
0);
Configuration.NATIVE_CONFIG_VERSION);
if (parentName != null) {
String parentClassName = buildClassName(a.info.packageName, parentName, outError);
if (outError[0] == null) {
@@ -3656,7 +3663,8 @@ public class PackageParser {
if (args.processRes != 0) {
CharSequence pname;
if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.FROYO) {
pname = args.sa.getNonConfigurationString(args.processRes, 0);
pname = args.sa.getNonConfigurationString(args.processRes,
Configuration.NATIVE_CONFIG_VERSION);
} else {
// Some older apps have been seen to use a resource reference
// here that on older builds was ignored (with a warning). We

View File

@@ -544,7 +544,40 @@ public final class Configuration implements Parcelable, Comparable<Configuration
* @hide Internal book-keeping.
*/
public int seq;
/** @hide Native-specific bit mask for MCC config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_MCC = 0x0001;
/** @hide Native-specific bit mask for MNC config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_MNC = 0x0002;
/** @hide Native-specific bit mask for LOCALE config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_LOCALE = 0x0004;
/** @hide Native-specific bit mask for TOUCHSCREEN config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_TOUCHSCREEN = 0x0008;
/** @hide Native-specific bit mask for KEYBOARD config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_KEYBOARD = 0x0010;
/** @hide Native-specific bit mask for KEYBOARD_HIDDEN config; DO NOT USE UNLESS YOU
* ARE SURE. */
public static final int NATIVE_CONFIG_KEYBOARD_HIDDEN = 0x0020;
/** @hide Native-specific bit mask for NAVIGATION config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_NAVIGATION = 0x0040;
/** @hide Native-specific bit mask for ORIENTATION config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_ORIENTATION = 0x0080;
/** @hide Native-specific bit mask for DENSITY config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_DENSITY = 0x0100;
/** @hide Native-specific bit mask for SCREEN_SIZE config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_SCREEN_SIZE = 0x0200;
/** @hide Native-specific bit mask for VERSION config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_VERSION = 0x0400;
/** @hide Native-specific bit mask for SCREEN_LAYOUT config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_SCREEN_LAYOUT = 0x0800;
/** @hide Native-specific bit mask for UI_MODE config; DO NOT USE UNLESS YOU ARE SURE. */
public static final int NATIVE_CONFIG_UI_MODE = 0x1000;
/** @hide Native-specific bit mask for SMALLEST_SCREEN_SIZE config; DO NOT USE UNLESS YOU
* ARE SURE. */
public static final int NATIVE_CONFIG_SMALLEST_SCREEN_SIZE = 0x2000;
/** @hide Native-specific bit mask for LAYOUTDIR config ; DO NOT USE UNLESS YOU ARE SURE.*/
public static final int NATIVE_CONFIG_LAYOUTDIR = 0x4000;
/**
* Construct an invalid Configuration. You must call {@link #setToDefaults}
* for this object to be valid. {@more}

View File

@@ -16,6 +16,7 @@
package android.content.res;
import android.content.pm.ActivityInfo;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
@@ -170,8 +171,8 @@ public class TypedArray {
*
* @param index Index of attribute to retrieve.
* @param allowedChangingConfigs Bit mask of configurations from
* ActivityInfo that are allowed to change.
*
* {@link Configuration}.NATIVE_CONFIG_* that are allowed to change.
*
* @return String holding string data. Any styling information is
* removed. Returns null if the attribute is not defined.
*/