diff options
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | api/system-current.txt | 2 | ||||
| -rw-r--r-- | api/test-current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageParser.java | 14 | ||||
| -rw-r--r-- | core/res/res/values/attrs_manifest.xml | 22 | ||||
| -rw-r--r-- | core/res/res/values/public.xml | 2 | ||||
| -rw-r--r-- | core/tests/coretests/src/android/content/pm/PackageParserTest.java | 26 |
7 files changed, 35 insertions, 35 deletions
diff --git a/api/current.txt b/api/current.txt index e3e4d9904d18..c9bc79951ac8 100644 --- a/api/current.txt +++ b/api/current.txt @@ -1061,6 +1061,7 @@ package android { field public static final int ratingBarStyleSmall = 16842877; // 0x101007d field public static final int readPermission = 16842759; // 0x1010007 field public static final int recognitionService = 16843932; // 0x101049c + field public static final int recreateOnConfigChanges = 16844105; // 0x1010549 field public static final int recycleEnabled = 16844124; // 0x101055c field public static final int relinquishTaskIdentity = 16843894; // 0x1010476 field public static final int reparent = 16843964; // 0x10104bc @@ -1085,7 +1086,6 @@ package android { field public static final int resizeable = 16843405; // 0x101028d field public static final int resizeableActivity = 16844022; // 0x10104f6 field public static final int resource = 16842789; // 0x1010025 - field public static final int restartOnConfigChanges = 16844105; // 0x1010549 field public static final int restoreAnyVersion = 16843450; // 0x10102ba field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d field public static final int restrictedAccountType = 16843733; // 0x10103d5 diff --git a/api/system-current.txt b/api/system-current.txt index 1b827951ce81..be96737a84f1 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -1182,6 +1182,7 @@ package android { field public static final int ratingBarStyleSmall = 16842877; // 0x101007d field public static final int readPermission = 16842759; // 0x1010007 field public static final int recognitionService = 16843932; // 0x101049c + field public static final int recreateOnConfigChanges = 16844105; // 0x1010549 field public static final int recycleEnabled = 16844124; // 0x101055c field public static final int relinquishTaskIdentity = 16843894; // 0x1010476 field public static final int reparent = 16843964; // 0x10104bc @@ -1208,7 +1209,6 @@ package android { field public static final int resizeable = 16843405; // 0x101028d field public static final int resizeableActivity = 16844022; // 0x10104f6 field public static final int resource = 16842789; // 0x1010025 - field public static final int restartOnConfigChanges = 16844105; // 0x1010549 field public static final int restoreAnyVersion = 16843450; // 0x10102ba field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d field public static final int restrictedAccountType = 16843733; // 0x10103d5 diff --git a/api/test-current.txt b/api/test-current.txt index 5d4b08040f61..592a3c62ed77 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -1061,6 +1061,7 @@ package android { field public static final int ratingBarStyleSmall = 16842877; // 0x101007d field public static final int readPermission = 16842759; // 0x1010007 field public static final int recognitionService = 16843932; // 0x101049c + field public static final int recreateOnConfigChanges = 16844105; // 0x1010549 field public static final int recycleEnabled = 16844124; // 0x101055c field public static final int relinquishTaskIdentity = 16843894; // 0x1010476 field public static final int reparent = 16843964; // 0x10104bc @@ -1085,7 +1086,6 @@ package android { field public static final int resizeable = 16843405; // 0x101028d field public static final int resizeableActivity = 16844022; // 0x10104f6 field public static final int resource = 16842789; // 0x1010025 - field public static final int restartOnConfigChanges = 16844105; // 0x1010549 field public static final int restoreAnyVersion = 16843450; // 0x10102ba field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d field public static final int restrictedAccountType = 16843733; // 0x10103d5 diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 101317784c17..9b0bab427478 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -201,10 +201,10 @@ public class PackageParser { private static final String META_DATA_INSTANT_APPS = "instantapps.clients.allowed"; /** - * Bit mask of all the valid bits that can be set in restartOnConfigChanges. + * Bit mask of all the valid bits that can be set in recreateOnConfigChanges. * @hide */ - private static final int RESTART_ON_CONFIG_CHANGES_MASK = + private static final int RECREATE_ON_CONFIG_CHANGES_MASK = ActivityInfo.CONFIG_MCC | ActivityInfo.CONFIG_MNC; // These are the tags supported by child packages @@ -4219,7 +4219,7 @@ public class PackageParser { ActivityManager.getDefaultAppRecentsLimitStatic()); a.info.configChanges = getActivityConfigChanges( sa.getInt(R.styleable.AndroidManifestActivity_configChanges, 0), - sa.getInt(R.styleable.AndroidManifestActivity_restartOnConfigChanges, 0)); + sa.getInt(R.styleable.AndroidManifestActivity_recreateOnConfigChanges, 0)); a.info.softInputMode = sa.getInt( R.styleable.AndroidManifestActivity_windowSoftInputMode, 0); @@ -4523,13 +4523,13 @@ public class PackageParser { /** * @param configChanges The bit mask of configChanges fetched from AndroidManifest.xml. - * @param restartOnConfigChanges The bit mask restartOnConfigChanges fetched from - * AndroidManifest.xml. + * @param recreateOnConfigChanges The bit mask recreateOnConfigChanges fetched from + * AndroidManifest.xml. * @hide Exposed for unit testing only. */ @TestApi - public static int getActivityConfigChanges(int configChanges, int restartOnConfigChanges) { - return configChanges | ((~restartOnConfigChanges) & RESTART_ON_CONFIG_CHANGES_MASK); + public static int getActivityConfigChanges(int configChanges, int recreateOnConfigChanges) { + return configChanges | ((~recreateOnConfigChanges) & RECREATE_ON_CONFIG_CHANGES_MASK); } private void parseLayout(Resources res, AttributeSet attrs, Activity a) { diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index b7bc7b7a5fe3..ced22cc37f5a 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -784,13 +784,13 @@ <enum name="locked" value="14" /> </attr> - <!-- Specify the configuration changes that trigger the system to restart the + <!-- Specify the configuration changes that trigger the system to recreate the current activity if any of these configuration changes happen in the system. The valid configuration changes include mcc and mnc which are the same with - those in configChanges. By default from Android O, we don't restart the activity + those in configChanges. By default from Android O, we don't recreate the activity even the app doesn't specify mcc or mnc in configChanges. If the app wants to - restart, specify them in restartOnConfigChanges. --> - <attr name="restartOnConfigChanges"> + be recreated, specify them in recreateOnConfigChanges. --> + <attr name="recreateOnConfigChanges"> <!-- The IMSI MCC has changed, that is a SIM has been detected and updated the Mobile Country Code. --> <flag name="mcc" value="0x0001" /> @@ -817,15 +817,15 @@ <attr name="configChanges"> <!-- The IMSI MCC has changed, that is a SIM has been detected and updated the Mobile Country Code. By default from Android O, we - don't restart the activity even the app doesn't specify mcc in - configChanges. If the app wants to restart, specify mcc in - restartOnConfigChanges. --> + don't recreate the activity even the app doesn't specify mcc in + configChanges. If the app wants to recreate the activity, specify + mcc in recreateOnConfigChanges. --> <flag name="mcc" value="0x0001" /> <!-- The IMSI MNC has changed, that is a SIM has been detected and updated the Mobile Network Code. By default from Android O, we - don't restart the activity even the app doesn't specify mnc in - configChanges. If the app wants to restart, specify mnc in - restartOnConfigChanges. --> + don't recreate the activity even the app doesn't specify mnc in + configChanges. If the app wants to recreate the acvitity, specify + mnc in recreateOnConfigChanges. --> <flag name="mnc" value="0x0002" /> <!-- The locale has changed, that is the user has selected a new language that text should be displayed in. --> @@ -2048,7 +2048,7 @@ <attr name="launchMode" /> <attr name="screenOrientation" /> <attr name="configChanges" /> - <attr name="restartOnConfigChanges" /> + <attr name="recreateOnConfigChanges" /> <attr name="permission" /> <attr name="multiprocess" /> <attr name="process" /> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index d8b785087ddd..42d3f27eccfb 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2786,7 +2786,7 @@ <public name="appCategory" /> <public name="autoSizeMaxTextSize" /> <public name="__removed2" /> - <public name="restartOnConfigChanges" /> + <public name="recreateOnConfigChanges" /> <public name="certDigest" /> <public name="splitName" /> <public name="colorMode" /> diff --git a/core/tests/coretests/src/android/content/pm/PackageParserTest.java b/core/tests/coretests/src/android/content/pm/PackageParserTest.java index ca4141afae2d..b9bd193ad48c 100644 --- a/core/tests/coretests/src/android/content/pm/PackageParserTest.java +++ b/core/tests/coretests/src/android/content/pm/PackageParserTest.java @@ -220,41 +220,41 @@ public class PackageParserTest { * Unit test for PackageParser.getActivityConfigChanges(). * If the bit is 1 in the original configChanges, it is still 1 in the final configChanges. * If the bit is 0 in the original configChanges and the bit is not set to 1 in - * restartOnConfigChanges, the bit is changed to 1 in the final configChanges by default. + * recreateOnConfigChanges, the bit is changed to 1 in the final configChanges by default. */ @Test public void testGetActivityConfigChanges() { - // Not set in either configChanges or restartOnConfigChanges. + // Not set in either configChanges or recreateOnConfigChanges. int configChanges = 0x0000; // 00000000. - int restartOnConfigChanges = 0x0000; // 00000000. + int recreateOnConfigChanges = 0x0000; // 00000000. int finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0003, finalConfigChanges); // Should be 00000011. - // Not set in configChanges, but set in restartOnConfigChanges. + // Not set in configChanges, but set in recreateOnConfigChanges. configChanges = 0x0000; // 00000000. - restartOnConfigChanges = 0x0003; // 00000011. + recreateOnConfigChanges = 0x0003; // 00000011. finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0000, finalConfigChanges); // Should be 00000000. // Set in configChanges. configChanges = 0x0003; // 00000011. - restartOnConfigChanges = 0X0000; // 00000000. + recreateOnConfigChanges = 0X0000; // 00000000. finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0003, finalConfigChanges); // Should be 00000011. - restartOnConfigChanges = 0x0003; // 00000011. + recreateOnConfigChanges = 0x0003; // 00000011. finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0003, finalConfigChanges); // Should still be 00000011. // Other bit set in configChanges. configChanges = 0x0080; // 10000000, orientation. - restartOnConfigChanges = 0x0000; // 00000000. + recreateOnConfigChanges = 0x0000; // 00000000. finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0083, finalConfigChanges); // Should be 10000011. } } |