summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/SecuritySettings.java
diff options
context:
space:
mode:
authorGeoffrey Borggaard <geoffreyb@google.com>2013-08-07 14:57:43 -0400
committerGeoffrey Borggaard <geoffreyb@google.com>2013-08-07 14:57:43 -0400
commit6e1102d9faf1b8f038857709412c291ef6140aa9 (patch)
tree5969c274c388cca35730010b4870ab060ad08305 /src/com/android/settings/SecuritySettings.java
parent8a181dd0d1e710a2376488b158d71db915f73be6 (diff)
downloadpackages_apps_Settings-6e1102d9faf1b8f038857709412c291ef6140aa9.zip
packages_apps_Settings-6e1102d9faf1b8f038857709412c291ef6140aa9.tar.gz
packages_apps_Settings-6e1102d9faf1b8f038857709412c291ef6140aa9.tar.bz2
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
Diffstat (limited to 'src/com/android/settings/SecuritySettings.java')
-rw-r--r--src/com/android/settings/SecuritySettings.java20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 7a442a9..f893c36 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -45,7 +45,6 @@ import android.util.Log;
import com.android.internal.widget.LockPatternUtils;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
/**
@@ -75,6 +74,7 @@ public class SecuritySettings extends RestrictedSettingsFragment
private static final String KEY_SHOW_PASSWORD = "show_password";
private static final String KEY_CREDENTIAL_STORAGE_TYPE = "credential_storage_type";
private static final String KEY_RESET_CREDENTIALS = "reset_credentials";
+ private static final String KEY_CREDENTIALS_INSTALL = "credentials_install";
private static final String KEY_TOGGLE_INSTALL_APPLICATIONS = "toggle_install_applications";
private static final String KEY_TOGGLE_VERIFY_APPLICATIONS = "toggle_verify_applications";
private static final String KEY_POWER_INSTANTLY_LOCKS = "power_button_instantly_locks";
@@ -82,8 +82,6 @@ public class SecuritySettings extends RestrictedSettingsFragment
private static final String KEY_NOTIFICATION_ACCESS = "manage_notification_access";
private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive";
- private final HashSet<Preference> mProtectedByRestictionsPrefs = new HashSet<Preference>();
-
private PackageManager mPM;
DevicePolicyManager mDPM;
@@ -245,6 +243,7 @@ public class SecuritySettings extends RestrictedSettingsFragment
// Show password
mShowPassword = (CheckBoxPreference) root.findPreference(KEY_SHOW_PASSWORD);
+ mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS);
// Credential storage
final UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
@@ -257,7 +256,6 @@ public class SecuritySettings extends RestrictedSettingsFragment
: R.string.credential_storage_type_software;
credentialStorageType.setSummary(storageSummaryRes);
- mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS);
} else {
removePreference(KEY_CREDENTIALS_MANAGER);
}
@@ -312,16 +310,12 @@ public class SecuritySettings extends RestrictedSettingsFragment
if (shouldBePinProtected(RESTRICTIONS_PIN_SET)) {
protectByRestrictions(mToggleAppInstallation);
protectByRestrictions(mToggleVerifyApps);
+ protectByRestrictions(mResetCredentials);
+ protectByRestrictions(root.findPreference(KEY_CREDENTIALS_INSTALL));
}
return root;
}
- private void protectByRestrictions(Preference pref) {
- if (pref != null) {
- mProtectedByRestictionsPrefs.add(pref);
- }
- }
-
private int getNumEnabledNotificationListeners() {
final String flat = Settings.Secure.getString(getContentResolver(),
Settings.Secure.ENABLED_NOTIFICATION_LISTENERS);
@@ -487,11 +481,9 @@ public class SecuritySettings extends RestrictedSettingsFragment
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
- if (mProtectedByRestictionsPrefs.contains(preference)
- && !restrictionsPinCheck(RESTRICTIONS_PIN_SET)) {
- return false;
+ if (ensurePinRestrictedPreference(preference)) {
+ return true;
}
-
final String key = preference.getKey();
final LockPatternUtils lockPatternUtils = mChooseLockSettingsHelper.utils();