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

am: 5acb03575f

Change-Id: Ie8e346d71eaf4c3617753c83846cbd723582109e
This commit is contained in:
Fan Zhang
2017-04-29 07:00:01 +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();
}
}