Restriction pin changes.

Fixed bug in WirelessSettings where it was asking users for a PIN when
they weren't restricted.  Did this by refactoring the preference level
pin checking into the superclass, where it checks for the restricted mode first.
Also pin protected changes to certificates for restricted users.

Change-Id: I8310fd39f0862159668318fc1360ec6859cc00d5
This commit is contained in:
Geoffrey Borggaard
2013-08-07 14:57:43 -04:00
parent 8a181dd0d1
commit 6e1102d9fa
7 changed files with 98 additions and 40 deletions

View File

@@ -16,7 +16,6 @@
package com.android.settings;
import java.util.HashSet;
import android.app.Activity;
import android.app.AlertDialog;
@@ -75,7 +74,6 @@ public class WirelessSettings extends RestrictedSettingsFragment {
private static final int MANAGE_MOBILE_PLAN_DIALOG_ID = 1;
private static final String SAVED_MANAGE_MOBILE_PLAN_MSG = "mManageMobilePlanMessage";
private final HashSet<Preference> mProtectedByRestictionsPrefs = new HashSet<Preference>();
public WirelessSettings() {
super(null);
@@ -87,9 +85,8 @@ public class WirelessSettings extends RestrictedSettingsFragment {
*/
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (mProtectedByRestictionsPrefs.contains(preference) && !hasChallengeSucceeded()) {
restrictionsPinCheck(RESTRICTIONS_PIN_SET);
return false;
if (ensurePinRestrictedPreference(preference)) {
return true;
}
log("onPreferenceTreeClick: preference=" + preference);
if (preference == mAirplaneModePreference && Boolean.parseBoolean(
@@ -155,13 +152,6 @@ public class WirelessSettings extends RestrictedSettingsFragment {
}
}
private void protectByRestrictions(String key) {
Preference pref = findPreference(key);
if (pref != null) {
mProtectedByRestictionsPrefs.add(pref);
}
}
@Override
public Dialog onCreateDialog(int dialogId) {
log("onCreateDialog: dialogId=" + dialogId);