Cannot cancel in the "Warn app installation" dialog in security settings.

Bug: 16900059
Change-Id: Ie4e335b000350632bffc5740939b46b21357e298
This commit is contained in:
arete
2014-08-14 13:45:36 -07:00
committed by Di Wu
parent aa772c9521
commit 17224826f8

View File

@@ -404,16 +404,17 @@ public class SecuritySettings extends SettingsPreferenceFragment
.setIcon(com.android.internal.R.drawable.ic_dialog_alert) .setIcon(com.android.internal.R.drawable.ic_dialog_alert)
.setMessage(getResources().getString(R.string.install_all_warning)) .setMessage(getResources().getString(R.string.install_all_warning))
.setPositiveButton(android.R.string.yes, this) .setPositiveButton(android.R.string.yes, this)
.setNegativeButton(android.R.string.no, null) .setNegativeButton(android.R.string.no, this)
.show(); .show();
} }
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (dialog == mWarnInstallApps && which == DialogInterface.BUTTON_POSITIVE) { if (dialog == mWarnInstallApps) {
setNonMarketAppsAllowed(true); boolean turnOn = which == DialogInterface.BUTTON_POSITIVE;
setNonMarketAppsAllowed(turnOn);
if (mToggleAppInstallation != null) { if (mToggleAppInstallation != null) {
mToggleAppInstallation.setChecked(true); mToggleAppInstallation.setChecked(turnOn);
} }
} }
} }