Merge "Remove permission review build property - settings"

This commit is contained in:
TreeHugger Robot
2016-08-18 00:56:36 +00:00
committed by Android (Google) Code Review

View File

@@ -105,23 +105,29 @@ public class RequestToggleWiFiActivity extends AlertActivity
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (which != DialogInterface.BUTTON_POSITIVE) { switch (which) {
return; case DialogInterface.BUTTON_POSITIVE: {
} switch (mState) {
switch (mState) { case STATE_ENABLE: {
case STATE_ENABLE: { mWiFiManager.setWifiEnabled(true);
mWiFiManager.setWifiEnabled(true); mState = STATE_ENABLING;
mState = STATE_ENABLING; scheduleToggleTimeout();
scheduleToggleTimeout(); updateUi();
updateUi(); } break;
} break;
case STATE_DISABLE: { case STATE_DISABLE: {
mWiFiManager.setWifiEnabled(false); mWiFiManager.setWifiEnabled(false);
mState = STATE_DISABLING; mState = STATE_DISABLING;
scheduleToggleTimeout(); scheduleToggleTimeout();
updateUi(); updateUi();
} break; } break;
}
}
break;
case DialogInterface.BUTTON_NEGATIVE: {
finish();
}
break;
} }
} }
@@ -221,6 +227,8 @@ public class RequestToggleWiFiActivity extends AlertActivity
case STATE_ENABLE: { case STATE_ENABLE: {
mAlertParams.mPositiveButtonText = getString(android.R.string.ok); mAlertParams.mPositiveButtonText = getString(android.R.string.ok);
mAlertParams.mPositiveButtonListener = this; mAlertParams.mPositiveButtonListener = this;
mAlertParams.mNegativeButtonText = getString(android.R.string.no);
mAlertParams.mNegativeButtonListener = this;
mAlertParams.mMessage = getString(R.string.wifi_ask_enable, mAppLabel); mAlertParams.mMessage = getString(R.string.wifi_ask_enable, mAppLabel);
} break; } break;
@@ -228,14 +236,19 @@ public class RequestToggleWiFiActivity extends AlertActivity
// Params set button text only if non-null, but we want a null // Params set button text only if non-null, but we want a null
// button text to hide the button, so reset the controller directly. // button text to hide the button, so reset the controller directly.
mAlert.setButton(DialogInterface.BUTTON_POSITIVE, null, null, null); mAlert.setButton(DialogInterface.BUTTON_POSITIVE, null, null, null);
mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, null, null, null);
mAlertParams.mPositiveButtonText = null; mAlertParams.mPositiveButtonText = null;
mAlertParams.mPositiveButtonListener = null; mAlertParams.mPositiveButtonListener = null;
mAlertParams.mNegativeButtonText = null;
mAlertParams.mNegativeButtonListener = null;
mAlertParams.mMessage = getString(R.string.wifi_starting); mAlertParams.mMessage = getString(R.string.wifi_starting);
} break; } break;
case STATE_DISABLE: { case STATE_DISABLE: {
mAlertParams.mPositiveButtonText = getString(android.R.string.ok); mAlertParams.mPositiveButtonText = getString(android.R.string.ok);
mAlertParams.mPositiveButtonListener = this; mAlertParams.mPositiveButtonListener = this;
mAlertParams.mNegativeButtonText = getString(android.R.string.no);
mAlertParams.mNegativeButtonListener = this;
mAlertParams.mMessage = getString(R.string.wifi_ask_disable, mAppLabel); mAlertParams.mMessage = getString(R.string.wifi_ask_disable, mAppLabel);
} break; } break;
@@ -243,8 +256,11 @@ public class RequestToggleWiFiActivity extends AlertActivity
// Params set button text only if non-null, but we want a null // Params set button text only if non-null, but we want a null
// button text to hide the button, so reset the controller directly. // button text to hide the button, so reset the controller directly.
mAlert.setButton(DialogInterface.BUTTON_POSITIVE, null, null, null); mAlert.setButton(DialogInterface.BUTTON_POSITIVE, null, null, null);
mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, null, null, null);
mAlertParams.mPositiveButtonText = null; mAlertParams.mPositiveButtonText = null;
mAlertParams.mPositiveButtonListener = null; mAlertParams.mPositiveButtonListener = null;
mAlertParams.mNegativeButtonText = null;
mAlertParams.mNegativeButtonListener = null;
mAlertParams.mMessage = getString(R.string.wifi_stopping); mAlertParams.mMessage = getString(R.string.wifi_stopping);
} break; } break;
} }