- protected boolean restrictionsPinCheck(String restrictionsKey, Preference preference) {
- if (shouldBePinProtected(restrictionsKey) && !mChallengeSucceeded) {
- ensurePin(preference);
- return false;
- } else {
- return true;
- }
- }
-
- protected boolean hasChallengeSucceeded() {
- return mChallengeSucceeded;
- }
-
- /**
- * Returns true if this restrictions key is locked down.
- */
- protected boolean shouldBePinProtected(String restrictionKey) {
- if (restrictionKey == null) {
- return false;
- }
- boolean restricted = RESTRICTIONS_PIN_SET.equals(restrictionKey)
- || mUserManager.hasUserRestriction(restrictionKey);
- return restricted && mUserManager.hasRestrictionsChallenge();
- }
-
- /**
- * If the preference is one that was added by protectByRestrictions(), then it will
- * prompt the user for the restrictions pin if they haven't entered it already.
- * Intended to be called at the top of onPreferenceTreeClick. If this function returns
- * true, then onPreferenceTreeClick should return true.
- */
- boolean ensurePinRestrictedPreference(Preference preference) {
- return mProtectedByRestictionsPrefs.contains(preference)
- && !restrictionsPinCheck(RESTRICTIONS_PIN_SET, preference);
- }
+ protected boolean shouldBeProviderProtected(String restrictionKey) {
+ if (restrictionKey == null) {
+ return false;
+ }
+ boolean restricted = RESTRICT_IF_OVERRIDABLE.equals(restrictionKey)
+ || mUserManager.hasUserRestriction(mRestrictionKey);
+ return restricted && mRestrictionsManager.hasRestrictionsProvider();
+ }