From d5d60655a9c23ba02b5fc1264fb1680f599b3b07 Mon Sep 17 00:00:00 2001 From: rich cannings Date: Fri, 7 Sep 2012 13:20:44 -0700 Subject: [PATCH] Add package verification to settings app Adds a dialog/toggle in security settings to turn package verification on and off. Bug: 7082362 Change-Id: I9985437ae28e4a999992c91a7e88547495ccbda2 --- res/values/strings.xml | 4 ++++ res/xml/security_settings_misc.xml | 6 ++++++ src/com/android/settings/SecuritySettings.java | 15 +++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/res/values/strings.xml b/res/values/strings.xml index fd001847fcf..ba3f3865fb5 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2385,6 +2385,10 @@ from unknown sources. You agree that you are solely responsible for any damage to your phone or loss of data that may result from using these apps. + + App check + + Disallow or warn before installation of apps that may cause harm Advanced settings diff --git a/res/xml/security_settings_misc.xml b/res/xml/security_settings_misc.xml index 9f78820e342..6f9311af4ad 100644 --- a/res/xml/security_settings_misc.xml +++ b/res/xml/security_settings_misc.xml @@ -52,6 +52,12 @@ android:summaryOn="@string/install_unknown_applications" android:persistent="false" /> + 0; + } + private void warnAppInstallation() { // TODO: DialogFragment? mWarnInstallApps = new AlertDialog.Builder(getActivity()).setTitle( @@ -420,6 +432,9 @@ public class SecuritySettings extends SettingsPreferenceFragment } else { setNonMarketAppsAllowed(false); } + } else if (KEY_TOGGLE_VERIFY_APPLICATIONS.equals(key)) { + Settings.Global.putInt(getContentResolver(), Settings.Global.PACKAGE_VERIFIER_ENABLE, + mToggleVerifyApps.isChecked() ? 1 : 0); } else { // If we didn't handle it, let preferences handle it. return super.onPreferenceTreeClick(preferenceScreen, preference);