diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 8154bca2cb89c..b8ac3bf9a8e00 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -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. diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 541dcb93d9563..6760f49174967 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -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] = " 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 diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 0402eeb94764a..48b6fca7b2d32 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -544,7 +544,40 @@ public final class Configuration implements Parcelable, Comparable