Merge "Don't hide network reset even if it's disabled by admin." into oc-dev

am: b50460086d

Change-Id: I3d1a1958999aed60b44da454f341ed711a64a589
This commit is contained in:
Fan Zhang
2017-04-29 06:58:11 +00:00
committed by android-build-merger
4 changed files with 79 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ public class NetworkResetPreferenceController extends PreferenceController {
@Override
public boolean isAvailable() {
return !mRestrictionChecker.hasRestriction();
return !mRestrictionChecker.hasUserRestriction();
}
@Override

View File

@@ -45,9 +45,13 @@ public class NetworkResetRestrictionChecker {
mContext, UserManager.DISALLOW_NETWORK_RESET, UserHandle.myUserId()) != null;
}
boolean hasRestriction() {
boolean hasUserRestriction() {
return !mUserManager.isAdminUser()
|| hasUserBaseRestriction()
|| hasUserBaseRestriction();
}
boolean hasRestriction() {
return hasUserRestriction()
|| isRestrictionEnforcedByAdmin();
}
}