OSDN Git Service

Remove "Verify apps" from Security settings
authorrich cannings <richc@google.com>
Mon, 21 Jul 2014 23:12:49 +0000 (16:12 -0700)
committerrich cannings <richc@google.com>
Thu, 24 Jul 2014 22:13:23 +0000 (15:13 -0700)
The setting moved to Google settings

Bug: 15588470
Change-Id: I40c0b6073949a69bfb8f0fa8f9fd405fbf9946de

res/values/strings.xml
res/xml/security_settings_misc.xml
src/com/android/settings/SecuritySettings.java

index beff7d9..fd3c249 100644 (file)
  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.</string>
-    <!-- Applications settings screen, setting check box title. If checked, the system will send package verification requests to package verifiers on the device who will ultimately allow or reject the installation of applications. [CHAR LIMIT=30] -->
-    <string name="verify_applications">Verify apps</string>
-    <!-- Applications settings screen, setting check box summary. This is the summary for "App Check" checkbox. [CHAR LIMIT=none] -->
-    <string name="verify_applications_summary">Regularly check device activity for security problems, and prevent or warn about potential harm.</string>
     <!-- Applications settings screen, setting check box title. If checked, applications show more settings options. -->
     <string name="advanced_settings">Advanced settings</string>
     <!-- Applications settings screen, setting check box summary.  This is the summary for "Advanced settings" checkbox  -->
index 06743a5..ed63028 100644 (file)
                 android:summaryOn="@string/install_unknown_applications"
                 android:persistent="false" />
 
-        <CheckBoxPreference android:key="toggle_verify_applications"
-                android:title="@string/verify_applications"
-                android:summaryOff="@string/verify_applications_summary"
-                android:summaryOn="@string/verify_applications_summary"
-                android:persistent="false" />
-
     </PreferenceCategory>
 
     <PreferenceCategory android:key="credentials_management"
index 30fe74a..e5f7736 100644 (file)
@@ -89,7 +89,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
     private static final String KEY_RESET_CREDENTIALS = "credentials_reset";
     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";
     private static final String KEY_CREDENTIALS_MANAGER = "credentials_management";
     private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive";
@@ -112,7 +111,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
 
     private CheckBoxPreference mToggleAppInstallation;
     private DialogInterface mWarnInstallApps;
-    private CheckBoxPreference mToggleVerifyApps;
     private CheckBoxPreference mPowerButtonInstantlyLocks;
 
     private boolean mIsPrimary;
@@ -343,26 +341,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
             mToggleAppInstallation.setEnabled(false);
         }
 
-        // Package verification, only visible to primary user and if enabled
-        mToggleVerifyApps = (CheckBoxPreference) findPreference(KEY_TOGGLE_VERIFY_APPLICATIONS);
-        if (mIsPrimary && showVerifierSetting()) {
-            if (isVerifierInstalled()) {
-                mToggleVerifyApps.setChecked(isVerifyAppsEnabled());
-            } else {
-                mToggleVerifyApps.setChecked(false);
-                mToggleVerifyApps.setEnabled(false);
-            }
-        } else {
-            if (deviceAdminCategory != null) {
-                deviceAdminCategory.removePreference(mToggleVerifyApps);
-            } else {
-                mToggleVerifyApps.setEnabled(false);
-            }
-        }
-        if (um.hasUserRestriction(UserManager.ENSURE_VERIFY_APPS)) {
-            mToggleVerifyApps.setEnabled(false);
-        }
-
         return root;
     }
 
@@ -381,25 +359,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
                                 enabled ? 1 : 0);
     }
 
-    private boolean isVerifyAppsEnabled() {
-        return Settings.Global.getInt(getContentResolver(),
-                                      Settings.Global.PACKAGE_VERIFIER_ENABLE, 1) > 0;
-    }
-
-    private boolean isVerifierInstalled() {
-        final PackageManager pm = getPackageManager();
-        final Intent verification = new Intent(Intent.ACTION_PACKAGE_NEEDS_VERIFICATION);
-        verification.setType(PACKAGE_MIME_TYPE);
-        verification.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
-        final List<ResolveInfo> receivers = pm.queryBroadcastReceivers(verification, 0);
-        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(
@@ -583,9 +542,6 @@ 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 (KEY_TRUST_AGENT.equals(key)) {
             ChooseLockSettingsHelper helper =
                     new ChooseLockSettingsHelper(this.getActivity(), this);