From bbc3045a265238fd80547dd9bb61f6801a038886 Mon Sep 17 00:00:00 2001 From: rich cannings Date: Sun, 16 Sep 2012 13:58:07 -0700 Subject: Ability to hide verification settings Add a setting that controls the visibility of the package verification setting in the Settings app. Bug:7022814 Change-Id: I6e503924adc112b4528d94b1e533baae6079e85e --- src/com/android/settings/SecuritySettings.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index ce59fdd..d896a68 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -245,12 +245,14 @@ public class SecuritySettings extends SettingsPreferenceFragment mToggleAppInstallation.setChecked(isNonMarketAppsAllowed()); // Package verification - mToggleVerifyApps = (CheckBoxPreference) findPreference(KEY_TOGGLE_VERIFY_APPLICATIONS); - if (isVerifierInstalled()) { - mToggleVerifyApps.setChecked(isVerifyAppsEnabled()); - } else { - mToggleVerifyApps.setChecked(false); - mToggleVerifyApps.setEnabled(false); + if (showVerifierSetting()) { + mToggleVerifyApps = (CheckBoxPreference) findPreference(KEY_TOGGLE_VERIFY_APPLICATIONS); + if (isVerifierInstalled()) { + mToggleVerifyApps.setChecked(isVerifyAppsEnabled()); + } else { + mToggleVerifyApps.setChecked(false); + mToggleVerifyApps.setEnabled(false); + } } mUserSelectedWidget = root.findPreference(KEY_CHOOSE_USER_SELECTED_LOCKSCREEN_WIDGET); @@ -300,6 +302,11 @@ public class SecuritySettings extends SettingsPreferenceFragment return (receivers.size() > 0) ? true : false; } + private boolean showVerifierSetting() { + return Settings.Global.getInt(getContentResolver(), + Settings.Global.PACKAGE_VERIFIER_SETTING_VISIBLE, 1) > 0; + } + private void warnAppInstallation() { // TODO: DialogFragment? mWarnInstallApps = new AlertDialog.Builder(getActivity()).setTitle( -- cgit v1.1