summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorrich cannings <richc@google.com>2012-09-16 13:58:07 -0700
committerrich cannings <richc@google.com>2012-09-16 13:58:07 -0700
commitbbc3045a265238fd80547dd9bb61f6801a038886 (patch)
treef3c9b83f18253b35d3b825805901954114cfd675 /src
parent38305fb1777147cbcb86774c466e88434daff141 (diff)
downloadpackages_apps_settings-bbc3045a265238fd80547dd9bb61f6801a038886.zip
packages_apps_settings-bbc3045a265238fd80547dd9bb61f6801a038886.tar.gz
packages_apps_settings-bbc3045a265238fd80547dd9bb61f6801a038886.tar.bz2
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
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/SecuritySettings.java19
1 files changed, 13 insertions, 6 deletions
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(