Remove "Verify apps" from Security settings
The setting moved to Google settings Bug: 15588470 Change-Id: I40c0b6073949a69bfb8f0fa8f9fd405fbf9946de
This commit is contained in:
@@ -2821,10 +2821,6 @@
|
|||||||
from unknown sources. You agree that you are solely responsible for any
|
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
|
damage to your phone or loss of data that may result from using
|
||||||
these apps.</string>
|
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. -->
|
<!-- Applications settings screen, setting check box title. If checked, applications show more settings options. -->
|
||||||
<string name="advanced_settings">Advanced settings</string>
|
<string name="advanced_settings">Advanced settings</string>
|
||||||
<!-- Applications settings screen, setting check box summary. This is the summary for "Advanced settings" checkbox -->
|
<!-- Applications settings screen, setting check box summary. This is the summary for "Advanced settings" checkbox -->
|
||||||
|
@@ -57,12 +57,6 @@
|
|||||||
android:summaryOn="@string/install_unknown_applications"
|
android:summaryOn="@string/install_unknown_applications"
|
||||||
android:persistent="false" />
|
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>
|
||||||
|
|
||||||
<PreferenceCategory android:key="credentials_management"
|
<PreferenceCategory android:key="credentials_management"
|
||||||
|
@@ -89,7 +89,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
private static final String KEY_RESET_CREDENTIALS = "credentials_reset";
|
private static final String KEY_RESET_CREDENTIALS = "credentials_reset";
|
||||||
private static final String KEY_CREDENTIALS_INSTALL = "credentials_install";
|
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_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_POWER_INSTANTLY_LOCKS = "power_button_instantly_locks";
|
||||||
private static final String KEY_CREDENTIALS_MANAGER = "credentials_management";
|
private static final String KEY_CREDENTIALS_MANAGER = "credentials_management";
|
||||||
private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive";
|
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 CheckBoxPreference mToggleAppInstallation;
|
||||||
private DialogInterface mWarnInstallApps;
|
private DialogInterface mWarnInstallApps;
|
||||||
private CheckBoxPreference mToggleVerifyApps;
|
|
||||||
private CheckBoxPreference mPowerButtonInstantlyLocks;
|
private CheckBoxPreference mPowerButtonInstantlyLocks;
|
||||||
|
|
||||||
private boolean mIsPrimary;
|
private boolean mIsPrimary;
|
||||||
@@ -343,26 +341,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
mToggleAppInstallation.setEnabled(false);
|
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;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,25 +359,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
enabled ? 1 : 0);
|
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() {
|
private void warnAppInstallation() {
|
||||||
// TODO: DialogFragment?
|
// TODO: DialogFragment?
|
||||||
mWarnInstallApps = new AlertDialog.Builder(getActivity()).setTitle(
|
mWarnInstallApps = new AlertDialog.Builder(getActivity()).setTitle(
|
||||||
@@ -583,9 +542,6 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
} else {
|
} else {
|
||||||
setNonMarketAppsAllowed(false);
|
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)) {
|
} else if (KEY_TRUST_AGENT.equals(key)) {
|
||||||
ChooseLockSettingsHelper helper =
|
ChooseLockSettingsHelper helper =
|
||||||
new ChooseLockSettingsHelper(this.getActivity(), this);
|
new ChooseLockSettingsHelper(this.getActivity(), this);
|
||||||
|
Reference in New Issue
Block a user