Merge "Allow requiredForAllUsers to work on updates to system apps" into jb-mr2-dev

This commit is contained in:
Amith Yamasani
2013-05-02 04:26:01 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 6 deletions

View File

@ -109,6 +109,7 @@ public class RestrictionEntry implements Parcelable {
*/ */
public RestrictionEntry(String key, String selectedString) { public RestrictionEntry(String key, String selectedString) {
this.key = key; this.key = key;
this.type = TYPE_CHOICE;
this.currentValue = selectedString; this.currentValue = selectedString;
} }
@ -119,6 +120,7 @@ public class RestrictionEntry implements Parcelable {
*/ */
public RestrictionEntry(String key, boolean selectedState) { public RestrictionEntry(String key, boolean selectedState) {
this.key = key; this.key = key;
this.type = TYPE_BOOLEAN;
setSelectedState(selectedState); setSelectedState(selectedState);
} }
@ -129,6 +131,7 @@ public class RestrictionEntry implements Parcelable {
*/ */
public RestrictionEntry(String key, String[] selectedStrings) { public RestrictionEntry(String key, String[] selectedStrings) {
this.key = key; this.key = key;
this.type = TYPE_MULTI_SELECT;
this.currentValues = selectedStrings; this.currentValues = selectedStrings;
} }

View File

@ -287,7 +287,10 @@ public class PackageParser {
pi.sharedUserLabel = p.mSharedUserLabel; pi.sharedUserLabel = p.mSharedUserLabel;
pi.applicationInfo = generateApplicationInfo(p, flags, state, userId); pi.applicationInfo = generateApplicationInfo(p, flags, state, userId);
pi.installLocation = p.installLocation; 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.restrictedAccountType = p.mRestrictedAccountType;
pi.requiredAccountType = p.mRequiredAccountType; pi.requiredAccountType = p.mRequiredAccountType;
pi.firstInstallTime = firstInstallTime; pi.firstInstallTime = firstInstallTime;
@ -1812,11 +1815,12 @@ public class PackageParser {
false)) { false)) {
ai.flags |= ApplicationInfo.FLAG_PERSISTENT; ai.flags |= ApplicationInfo.FLAG_PERSISTENT;
} }
if (sa.getBoolean( }
com.android.internal.R.styleable.AndroidManifestApplication_requiredForAllUsers,
false)) { if (sa.getBoolean(
owner.mRequiredForAllUsers = true; com.android.internal.R.styleable.AndroidManifestApplication_requiredForAllUsers,
} false)) {
owner.mRequiredForAllUsers = true;
} }
String restrictedAccountType = sa.getString(com.android.internal.R.styleable String restrictedAccountType = sa.getString(com.android.internal.R.styleable