summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2013-05-01 15:25:28 -0700
committerAmith Yamasani <yamasani@google.com>2013-05-01 15:31:49 -0700
commit0d8750d771c8ad4db6f1f590ecda4ac23f783a84 (patch)
treee17f15e8c8fb646ba27e57f104221d330e6aabdb
parent48f2b548edf8e276cc89d2c4c2d2936cde46fc95 (diff)
downloadframeworks_base-0d8750d771c8ad4db6f1f590ecda4ac23f783a84.zip
frameworks_base-0d8750d771c8ad4db6f1f590ecda4ac23f783a84.tar.gz
frameworks_base-0d8750d771c8ad4db6f1f590ecda4ac23f783a84.tar.bz2
Allow requiredForAllUsers to work on updates to system apps
Bug: 8736380 Also set the default type as the constructor docs imply in RestrictionEntry. Change-Id: I446504fad8822804d68f09b45ef62f6d79c4b8df
-rw-r--r--core/java/android/content/RestrictionEntry.java3
-rw-r--r--core/java/android/content/pm/PackageParser.java16
2 files changed, 13 insertions, 6 deletions
diff --git a/core/java/android/content/RestrictionEntry.java b/core/java/android/content/RestrictionEntry.java
index 217cf76..283a097 100644
--- a/core/java/android/content/RestrictionEntry.java
+++ b/core/java/android/content/RestrictionEntry.java
@@ -109,6 +109,7 @@ public class RestrictionEntry implements Parcelable {
*/
public RestrictionEntry(String key, String selectedString) {
this.key = key;
+ this.type = TYPE_CHOICE;
this.currentValue = selectedString;
}
@@ -119,6 +120,7 @@ public class RestrictionEntry implements Parcelable {
*/
public RestrictionEntry(String key, boolean selectedState) {
this.key = key;
+ this.type = TYPE_BOOLEAN;
setSelectedState(selectedState);
}
@@ -129,6 +131,7 @@ public class RestrictionEntry implements Parcelable {
*/
public RestrictionEntry(String key, String[] selectedStrings) {
this.key = key;
+ this.type = TYPE_MULTI_SELECT;
this.currentValues = selectedStrings;
}
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index acb3725..34e0c12 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -287,7 +287,10 @@ public class PackageParser {
pi.sharedUserLabel = p.mSharedUserLabel;
pi.applicationInfo = generateApplicationInfo(p, flags, state, userId);
pi.installLocation = p.installLocation;
- pi.requiredForAllUsers = p.mRequiredForAllUsers;
+ if ((pi.applicationInfo.flags&ApplicationInfo.FLAG_SYSTEM) != 0
+ || (pi.applicationInfo.flags&ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
+ pi.requiredForAllUsers = p.mRequiredForAllUsers;
+ }
pi.restrictedAccountType = p.mRestrictedAccountType;
pi.requiredAccountType = p.mRequiredAccountType;
pi.firstInstallTime = firstInstallTime;
@@ -1812,11 +1815,12 @@ public class PackageParser {
false)) {
ai.flags |= ApplicationInfo.FLAG_PERSISTENT;
}
- if (sa.getBoolean(
- com.android.internal.R.styleable.AndroidManifestApplication_requiredForAllUsers,
- false)) {
- owner.mRequiredForAllUsers = true;
- }
+ }
+
+ if (sa.getBoolean(
+ com.android.internal.R.styleable.AndroidManifestApplication_requiredForAllUsers,
+ false)) {
+ owner.mRequiredForAllUsers = true;
}
String restrictedAccountType = sa.getString(com.android.internal.R.styleable