summaryrefslogtreecommitdiffstats
path: root/core/java/android/content
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-02-11 12:37:12 -0800
committerAlex Klyubin <klyubin@google.com>2015-02-11 12:37:12 -0800
commit33d3c53da021f0d044028860ace0f4ad817273f5 (patch)
tree1ebd67dbfa35109595bd6258633abba7931f1290 /core/java/android/content
parentc093955af1434a7023093acb148ab152d915e59c (diff)
parent517e0274cb2cfd215b20622280d5e256e8282bbb (diff)
downloadframeworks_base-33d3c53da021f0d044028860ace0f4ad817273f5.zip
frameworks_base-33d3c53da021f0d044028860ace0f4ad817273f5.tar.gz
frameworks_base-33d3c53da021f0d044028860ace0f4ad817273f5.tar.bz2
resolved conflicts for merge of 517e0274 to lmp-mr1-dev-plus-aosp
Change-Id: Ic20b6c8851458483dd73a144bd5ae6e8d141e62a
Diffstat (limited to 'core/java/android/content')
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java83
-rw-r--r--core/java/android/content/pm/IPackageManager.aidl2
-rw-r--r--core/java/android/content/pm/PackageParser.java25
3 files changed, 69 insertions, 41 deletions
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index e07edba..e822708 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -334,14 +334,47 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
public static final int FLAG_FULL_BACKUP_ONLY = 1<<26;
/**
- * Value for {@link #flags}: true if the application is hidden via restrictions and for
+ * Value for {@link #flags}: true if code from this application will need to be
+ * loaded into other applications' processes. On devices that support multiple
+ * instruction sets, this implies the code might be loaded into a process that's
+ * using any of the devices supported instruction sets.
+ *
+ * <p> The system might treat such applications specially, for eg., by
+ * extracting the application's native libraries for all supported instruction
+ * sets or by compiling the application's dex code for all supported instruction
+ * sets.
+ */
+ public static final int FLAG_MULTIARCH = 1 << 31;
+
+ /**
+ * Flags associated with the application. Any combination of
+ * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
+ * {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and
+ * {@link #FLAG_ALLOW_TASK_REPARENTING}
+ * {@link #FLAG_ALLOW_CLEAR_USER_DATA}, {@link #FLAG_UPDATED_SYSTEM_APP},
+ * {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS},
+ * {@link #FLAG_SUPPORTS_NORMAL_SCREENS},
+ * {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_SUPPORTS_XLARGE_SCREENS},
+ * {@link #FLAG_RESIZEABLE_FOR_SCREENS},
+ * {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE},
+ * {@link #FLAG_ALLOW_BACKUP}, {@link #FLAG_KILL_AFTER_RESTORE},
+ * {@link #FLAG_RESTORE_ANY_VERSION}, {@link #FLAG_EXTERNAL_STORAGE},
+ * {@link #FLAG_LARGE_HEAP}, {@link #FLAG_STOPPED},
+ * {@link #FLAG_SUPPORTS_RTL}, {@link #FLAG_INSTALLED},
+ * {@link #FLAG_IS_DATA_ONLY}, {@link #FLAG_IS_GAME},
+ * {@link #FLAG_FULL_BACKUP_ONLY}, {@link #FLAG_MULTIARCH}.
+ */
+ public int flags = 0;
+
+ /**
+ * Value for {@link #privateFlags}: true if the application is hidden via restrictions and for
* most purposes is considered as not installed.
* {@hide}
*/
- public static final int FLAG_HIDDEN = 1<<27;
+ public static final int PRIVATE_FLAG_HIDDEN = 1<<0;
/**
- * Value for {@link #flags}: set to <code>true</code> if the application
+ * Value for {@link #privateFlags}: set to <code>true</code> if the application
* has reported that it is heavy-weight, and thus can not participate in
* the normal application lifecycle.
*
@@ -351,53 +384,31 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
*
* {@hide}
*/
- public static final int FLAG_CANT_SAVE_STATE = 1<<28;
+ public static final int PRIVATE_FLAG_CANT_SAVE_STATE = 1<<1;
/**
- * Value for {@link #flags}: Set to true if the application has been
+ * Value for {@link #privateFlags}: Set to true if the application has been
* installed using the forward lock option.
*
* NOTE: DO NOT CHANGE THIS VALUE! It is saved in packages.xml.
- *
+ *
* {@hide}
*/
- public static final int FLAG_FORWARD_LOCK = 1<<29;
+ public static final int PRIVATE_FLAG_FORWARD_LOCK = 1<<2;
/**
- * Value for {@link #flags}: set to {@code true} if the application
+ * Value for {@link #privateFlags}: set to {@code true} if the application
* is permitted to hold privileged permissions.
*
* {@hide}
*/
- public static final int FLAG_PRIVILEGED = 1<<30;
+ public static final int PRIVATE_FLAG_PRIVILEGED = 1<<3;
/**
- * Value for {@link #flags}: true if code from this application will need to be
- * loaded into other applications' processes. On devices that support multiple
- * instruction sets, this implies the code might be loaded into a process that's
- * using any of the devices supported instruction sets.
- *
- * <p> The system might treat such applications specially, for eg., by
- * extracting the application's native libraries for all supported instruction
- * sets or by compiling the application's dex code for all supported instruction
- * sets.
- */
- public static final int FLAG_MULTIARCH = 1 << 31;
-
- /**
- * Flags associated with the application. Any combination of
- * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
- * {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and
- * {@link #FLAG_ALLOW_TASK_REPARENTING}
- * {@link #FLAG_ALLOW_CLEAR_USER_DATA}, {@link #FLAG_UPDATED_SYSTEM_APP},
- * {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS},
- * {@link #FLAG_SUPPORTS_NORMAL_SCREENS},
- * {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_SUPPORTS_XLARGE_SCREENS},
- * {@link #FLAG_RESIZEABLE_FOR_SCREENS},
- * {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE},
- * {@link #FLAG_INSTALLED}, {@link #FLAG_IS_GAME}.
+ * Private/hidden flags. See {@code PRIVATE_FLAG_...} constants.
+ * {@hide}
*/
- public int flags = 0;
+ public int privateFlags;
/**
* The required smallest screen width the application can run on. If 0,
@@ -598,6 +609,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
pw.println(prefix + "processName=" + processName);
pw.println(prefix + "taskAffinity=" + taskAffinity);
pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
+ + " privateFlags=0x" + Integer.toHexString(privateFlags)
+ " theme=0x" + Integer.toHexString(theme));
pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp
+ " compatibleWidthLimitDp=" + compatibleWidthLimitDp
@@ -680,6 +692,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
className = orig.className;
theme = orig.theme;
flags = orig.flags;
+ privateFlags = orig.privateFlags;
requiresSmallestWidthDp = orig.requiresSmallestWidthDp;
compatibleWidthLimitDp = orig.compatibleWidthLimitDp;
largestWidthLimitDp = orig.largestWidthLimitDp;
@@ -730,6 +743,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
dest.writeString(className);
dest.writeInt(theme);
dest.writeInt(flags);
+ dest.writeInt(privateFlags);
dest.writeInt(requiresSmallestWidthDp);
dest.writeInt(compatibleWidthLimitDp);
dest.writeInt(largestWidthLimitDp);
@@ -779,6 +793,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
className = source.readString();
theme = source.readInt();
flags = source.readInt();
+ privateFlags = source.readInt();
requiresSmallestWidthDp = source.readInt();
compatibleWidthLimitDp = source.readInt();
largestWidthLimitDp = source.readInt();
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index 0dc86ad..b518498 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -111,6 +111,8 @@ interface IPackageManager {
int getFlagsForUid(int uid);
+ int getPrivateFlagsForUid(int uid);
+
boolean isUidPrivileged(int uid);
String[] getAppOpPermissionPackages(String permissionName);
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index d7d9e8b..77dc27a 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -799,6 +799,7 @@ public class PackageParser {
pkg.splitCodePaths = lite.splitCodePaths;
pkg.splitRevisionCodes = lite.splitRevisionCodes;
pkg.splitFlags = new int[num];
+ pkg.splitPrivateFlags = new int[num];
for (int i = 0; i < num; i++) {
parseSplitApk(pkg, i, assets, flags);
@@ -1404,7 +1405,7 @@ public class PackageParser {
/* Set the global "forward lock" flag */
if ((flags & PARSE_FORWARD_LOCK) != 0) {
- pkg.applicationInfo.flags |= ApplicationInfo.FLAG_FORWARD_LOCK;
+ pkg.applicationInfo.privateFlags |= ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK;
}
/* Set the global "on SD card" flag */
@@ -2607,7 +2608,7 @@ public class PackageParser {
if (sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestApplication_cantSaveState,
false)) {
- ai.flags |= ApplicationInfo.FLAG_CANT_SAVE_STATE;
+ ai.privateFlags |= ApplicationInfo.PRIVATE_FLAG_CANT_SAVE_STATE;
// A heavy-weight application can not be in a custom process.
// We can do direct compare because we intern all strings.
@@ -3162,7 +3163,8 @@ public class PackageParser {
sa.recycle();
- if (receiver && (owner.applicationInfo.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) {
+ if (receiver && (owner.applicationInfo.privateFlags
+ &ApplicationInfo.PRIVATE_FLAG_CANT_SAVE_STATE) != 0) {
// A heavy-weight application can not have receives in its main process
// We can do direct compare because we intern all strings.
if (a.info.processName == owner.packageName) {
@@ -3515,7 +3517,8 @@ public class PackageParser {
sa.recycle();
- if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) {
+ if ((owner.applicationInfo.privateFlags&ApplicationInfo.PRIVATE_FLAG_CANT_SAVE_STATE)
+ != 0) {
// A heavy-weight application can not have providers in its main process
// We can do direct compare because we intern all strings.
if (p.info.processName == owner.packageName) {
@@ -3794,7 +3797,8 @@ public class PackageParser {
sa.recycle();
- if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) {
+ if ((owner.applicationInfo.privateFlags&ApplicationInfo.PRIVATE_FLAG_CANT_SAVE_STATE)
+ != 0) {
// A heavy-weight application can not have services in its main process
// We can do direct compare because we intern all strings.
if (s.info.processName == owner.packageName) {
@@ -4212,6 +4216,13 @@ public class PackageParser {
/** Flags of any split APKs; ordered by parsed splitName */
public int[] splitFlags;
+ /**
+ * Private flags of any split APKs; ordered by parsed splitName.
+ *
+ * {@hide}
+ */
+ public int[] splitPrivateFlags;
+
public boolean baseHardwareAccelerated;
// For now we only support one application per package.
@@ -4647,9 +4658,9 @@ public class PackageParser {
ai.flags &= ~ApplicationInfo.FLAG_INSTALLED;
}
if (state.hidden) {
- ai.flags |= ApplicationInfo.FLAG_HIDDEN;
+ ai.privateFlags |= ApplicationInfo.PRIVATE_FLAG_HIDDEN;
} else {
- ai.flags &= ~ApplicationInfo.FLAG_HIDDEN;
+ ai.privateFlags &= ~ApplicationInfo.PRIVATE_FLAG_HIDDEN;
}
if (state.enabled == PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {
ai.enabled = true;