Merge "Call defuse even when restrictions bundle is empty" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f33e2da037
@@ -2359,11 +2359,13 @@ public class UserManagerService extends IUserManager.Stub {
|
|||||||
public void setApplicationRestrictions(String packageName, Bundle restrictions,
|
public void setApplicationRestrictions(String packageName, Bundle restrictions,
|
||||||
int userId) {
|
int userId) {
|
||||||
checkSystemOrRoot("set application restrictions");
|
checkSystemOrRoot("set application restrictions");
|
||||||
|
if (restrictions != null) {
|
||||||
|
restrictions.setDefusable(true);
|
||||||
|
}
|
||||||
synchronized (mPackagesLock) {
|
synchronized (mPackagesLock) {
|
||||||
if (restrictions == null || restrictions.isEmpty()) {
|
if (restrictions == null || restrictions.isEmpty()) {
|
||||||
cleanAppRestrictionsForPackage(packageName, userId);
|
cleanAppRestrictionsForPackage(packageName, userId);
|
||||||
} else {
|
} else {
|
||||||
restrictions.setDefusable(true);
|
|
||||||
// Write the restrictions to XML
|
// Write the restrictions to XML
|
||||||
writeApplicationRestrictionsLP(packageName, restrictions, userId);
|
writeApplicationRestrictionsLP(packageName, restrictions, userId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user