summaryrefslogtreecommitdiffstats
path: root/core/tests/coretests/src
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-02-03 11:12:59 -0800
committerAlex Klyubin <klyubin@google.com>2015-02-11 11:06:40 -0800
commitb9f8a5204a1b0b3919fa921e858d04124c582828 (patch)
treec4faa0b3e8d1db30fc8a2deb3bb13b38de5a9364 /core/tests/coretests/src
parent3fbbe396faffeec6b46796087ad1e075e9a21f0d (diff)
downloadframeworks_base-b9f8a5204a1b0b3919fa921e858d04124c582828.zip
frameworks_base-b9f8a5204a1b0b3919fa921e858d04124c582828.tar.gz
frameworks_base-b9f8a5204a1b0b3919fa921e858d04124c582828.tar.bz2
Move hidden ApplicationInfo flags into a separate field.
The public API field android.content.pm.ApplicationInfo.flags can support only 32 flags. This limit has been reached. As a short term workaround to enable new public flags to be added, this CL moves flags which are not public API into a separate new field privateFlags and renames the affected flags constants accordingly (e.g., FLAG_PRIVILEGED is now PRIVATE_FLAG_PRIVILEGED). The new privateFlags field is not public API and should not be used for flags that are public API. The flags that are moved out of ApplicationInfo.flags are: * FLAG_HIDDEN, * FLAG_CANT_SAVE_STATE, * FLAG_FORWARD_LOCK, and * FLAG_PRIVILEGED. NOTE: This changes the format of packages.xml. Prior to this CL flags were stored in the "flags" attribute. With this CL, the public flags are stored in a new "publicFlags" attribute and private flags are stored in a new "privateFlags" attribute. The old "flags" attribute is interpreted by using the old values of hidden/private flags. Change-Id: Ie23eb8ddd5129de3c6e008c5261b639e22182ee5
Diffstat (limited to 'core/tests/coretests/src')
-rw-r--r--core/tests/coretests/src/android/content/pm/PackageManagerTests.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
index 3a80309..1530bb2 100644
--- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
+++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
@@ -419,7 +419,7 @@ public class PackageManagerTests extends AndroidTestCase {
if (rLoc == INSTALL_LOC_INT) {
if ((flags & PackageManager.INSTALL_FORWARD_LOCK) != 0) {
assertTrue("The application should be installed forward locked",
- (info.flags & ApplicationInfo.FLAG_FORWARD_LOCK) != 0);
+ (info.privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0);
assertStartsWith("The APK path should point to the ASEC",
SECURE_CONTAINERS_PREFIX, srcPath);
assertStartsWith("The public APK path should point to the ASEC",
@@ -435,7 +435,8 @@ public class PackageManagerTests extends AndroidTestCase {
fail("compat check: Can't read " + info.dataDir + "/lib");
}
} else {
- assertFalse((info.flags & ApplicationInfo.FLAG_FORWARD_LOCK) != 0);
+ assertFalse(
+ (info.privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0);
assertEquals(srcPath, appInstallPath);
assertEquals(publicSrcPath, appInstallPath);
assertStartsWith("Native library should point to shared lib directory",
@@ -462,16 +463,16 @@ public class PackageManagerTests extends AndroidTestCase {
} else if (rLoc == INSTALL_LOC_SD) {
if ((flags & PackageManager.INSTALL_FORWARD_LOCK) != 0) {
assertTrue("The application should be installed forward locked",
- (info.flags & ApplicationInfo.FLAG_FORWARD_LOCK) != 0);
+ (info.privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0);
} else {
assertFalse("The application should not be installed forward locked",
- (info.flags & ApplicationInfo.FLAG_FORWARD_LOCK) != 0);
+ (info.privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0);
}
assertTrue("Application flags (" + info.flags
+ ") should contain FLAG_EXTERNAL_STORAGE",
(info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0);
// Might need to check:
- // ((info.flags & ApplicationInfo.FLAG_FORWARD_LOCK) != 0)
+ // ((info.privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0)
assertStartsWith("The APK path should point to the ASEC",
SECURE_CONTAINERS_PREFIX, srcPath);
assertStartsWith("The public APK path should point to the ASEC",