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

This commit is contained in:
TreeHugger Robot
2017-04-29 06:53:26 +00:00
committed by Android (Google) Code Review
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();
}
}