diff --git a/res/xml/security_settings_misc.xml b/res/xml/security_settings_misc.xml index d724b740c24..aefbbd81a82 100644 --- a/res/xml/security_settings_misc.xml +++ b/res/xml/security_settings_misc.xml @@ -52,12 +52,6 @@ android:persistent="false" android:fragment="com.android.settings.DeviceAdminSettings"/> - - 0; - } - - private void setNonMarketAppsAllowed(boolean enabled) { - final UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE); - if (um.hasUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES)) { - return; - } - // Change the system setting - Settings.Global.putInt(getContentResolver(), Settings.Global.INSTALL_NON_MARKET_APPS, - enabled ? 1 : 0); - } - - private void warnAppInstallation() { - // TODO: DialogFragment? - mWarnInstallApps = new AlertDialog.Builder(getActivity()).setTitle( - getResources().getString(R.string.error_title)) - .setIcon(com.android.internal.R.drawable.ic_dialog_alert) - .setMessage(getResources().getString(R.string.install_all_warning)) - .setPositiveButton(android.R.string.yes, this) - .setNegativeButton(android.R.string.no, this) - .show(); - } - - @Override - public void onClick(DialogInterface dialog, int which) { - if (dialog == mWarnInstallApps) { - boolean turnOn = which == DialogInterface.BUTTON_POSITIVE; - setNonMarketAppsAllowed(turnOn); - if (mToggleAppInstallation != null) { - mToggleAppInstallation.setChecked(turnOn); - } - } - } - @Override public void onGearClick(GearPreference p) { if (KEY_UNLOCK_SET_OR_CHANGE.equals(p.getKey())) { @@ -644,14 +582,6 @@ public class SecuritySettings extends SettingsPreferenceFragment } } - @Override - public void onDestroy() { - super.onDestroy(); - if (mWarnInstallApps != null) { - mWarnInstallApps.dismiss(); - } - } - @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); @@ -857,15 +787,6 @@ public class SecuritySettings extends SettingsPreferenceFragment Settings.System.putInt(getContentResolver(), Settings.System.TEXT_SHOW_PASSWORD, ((Boolean) value) ? 1 : 0); lockPatternUtils.setVisiblePasswordEnabled((Boolean) value, MY_USER_ID); - } else if (KEY_TOGGLE_INSTALL_APPLICATIONS.equals(key)) { - if ((Boolean) value) { - mToggleAppInstallation.setChecked(false); - warnAppInstallation(); - // Don't change Switch status until user makes choice in dialog, so return false. - result = false; - } else { - setNonMarketAppsAllowed(false); - } } return result; }