• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisão09cda9cfaf658d85a5316cf6f07d5f8c038a942e (tree)
Hora2009-08-03 17:26:47
AutorHung-ying Tyan <tyanh@goog...>
CommiterHung-ying Tyan

Mensagem de Log

Add VPN connection lost dialog.

Mudança Sumário

Diff

--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1847,6 +1847,7 @@ found in the list of installed applications.</string>
18471847 <string name="vpn_confirm_add_profile_cancellation">Are you sure you don\'t want to create this profile?</string>
18481848 <string name="vpn_confirm_edit_profile_cancellation">Are you sure you want to discard the changes made to this profile?</string>
18491849 <string name="vpn_confirm_reconnect">Unable to connect to the network. Do you want to try again?</string>
1850+ <string name="vpn_reconnect_from_lost">Connection lost. Do you want to connect again?</string>
18501851 <string name="vpn_unknown_server_dialog_msg">Server name cannot be resolved. Do you want to check your server name setting?</string>
18511852 <string name="vpn_challenge_error_dialog_msg">Challenge error. Do you want to check your secret setting?</string>
18521853 <string name="vpn_secret_not_set_dialog_msg">One or more secrets are missing in this VPN configuration. Do you want to check your secret setting?</string>
--- a/src/com/android/settings/vpn/VpnSettings.java
+++ b/src/com/android/settings/vpn/VpnSettings.java
@@ -111,6 +111,7 @@ public class VpnSettings extends PreferenceActivity implements
111111 private static final int DIALOG_SECRET_NOT_SET = 5;
112112 private static final int DIALOG_CHALLENGE_ERROR = 6;
113113 private static final int DIALOG_REMOTE_HUNG_UP_ERROR = 7;
114+ private static final int DIALOG_CONNECTION_LOST = 8;
114115
115116 private static final int NO_ERROR = 0;
116117
@@ -218,6 +219,9 @@ public class VpnSettings extends PreferenceActivity implements
218219 case DIALOG_SECRET_NOT_SET:
219220 return createSecretNotSetDialog();
220221
222+ case DIALOG_CONNECTION_LOST:
223+ return createConnectionLostDialog();
224+
221225 default:
222226 return super.onCreateDialog(id);
223227 }
@@ -227,7 +231,7 @@ public class VpnSettings extends PreferenceActivity implements
227231 return new AlertDialog.Builder(this)
228232 .setView(mConnectingActor.createConnectView())
229233 .setTitle(String.format(getString(R.string.vpn_connect_to),
230- mConnectingActor.getProfile().getName()))
234+ mActiveProfile.getName()))
231235 .setPositiveButton(getString(R.string.vpn_connect_button),
232236 this)
233237 .setNegativeButton(getString(android.R.string.cancel),
@@ -277,8 +281,7 @@ public class VpnSettings extends PreferenceActivity implements
277281 .setPositiveButton(R.string.vpn_yes_button,
278282 new DialogInterface.OnClickListener() {
279283 public void onClick(DialogInterface dialog, int w) {
280- VpnProfile p = mConnectingActor.getProfile();
281- startVpnEditor(p);
284+ startVpnEditor(mActiveProfile);
282285 }
283286 })
284287 .create();
@@ -289,13 +292,19 @@ public class VpnSettings extends PreferenceActivity implements
289292 .setPositiveButton(R.string.vpn_yes_button,
290293 new DialogInterface.OnClickListener() {
291294 public void onClick(DialogInterface dialog, int w) {
292- VpnProfile p = mConnectingActor.getProfile();
295+ VpnProfile p = mActiveProfile;
293296 onIdle();
294297 startVpnEditor(p);
295298 }
296299 });
297300 }
298301
302+ private Dialog createConnectionLostDialog() {
303+ return createCommonDialogBuilder()
304+ .setMessage(R.string.vpn_reconnect_from_lost)
305+ .create();
306+ }
307+
299308 private AlertDialog.Builder createCommonDialogBuilder() {
300309 return new AlertDialog.Builder(this)
301310 .setTitle(android.R.string.dialog_alert_title)
@@ -303,7 +312,7 @@ public class VpnSettings extends PreferenceActivity implements
303312 .setPositiveButton(R.string.vpn_yes_button,
304313 new DialogInterface.OnClickListener() {
305314 public void onClick(DialogInterface dialog, int w) {
306- connectOrDisconnect(mConnectingActor.getProfile());
315+ connectOrDisconnect(mActiveProfile);
307316 }
308317 })
309318 .setNegativeButton(R.string.vpn_no_button,
@@ -442,7 +451,7 @@ public class VpnSettings extends PreferenceActivity implements
442451 Dialog d = (Dialog) dialog;
443452 String error = mConnectingActor.validateInputs(d);
444453 if (error == null) {
445- changeState(mConnectingActor.getProfile(), VpnState.CONNECTING);
454+ changeState(mActiveProfile, VpnState.CONNECTING);
446455 mConnectingActor.connect(d);
447456 removeDialog(DIALOG_CONNECT);
448457 return;
@@ -760,6 +769,10 @@ public class VpnSettings extends PreferenceActivity implements
760769 showDialog(DIALOG_UNKNOWN_SERVER);
761770 break;
762771
772+ case VpnManager.VPN_ERROR_CONNECTION_LOST:
773+ showDialog(DIALOG_CONNECTION_LOST);
774+ break;
775+
763776 default:
764777 showDialog(DIALOG_RECONNECT);
765778 break;