From 68bcab85324200395ccdcaa877e71780ad183e3b Mon Sep 17 00:00:00 2001 From: Hung-ying Tyan Date: Sun, 6 Mar 2011 01:53:45 +0800 Subject: [PATCH] Don't check states when mActiveProfile is present and is in IDLE state. checkVpnConnectionStatus() will clean up mActiveProfile if it's IDLE. Bug: 3513962 Change-Id: I8289fa321fdbd46def9c8207cef79cb45509897a --- src/com/android/settings/vpn/VpnSettings.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/vpn/VpnSettings.java b/src/com/android/settings/vpn/VpnSettings.java index e62a5ee0922..5d75b6a790e 100644 --- a/src/com/android/settings/vpn/VpnSettings.java +++ b/src/com/android/settings/vpn/VpnSettings.java @@ -221,7 +221,14 @@ public class VpnSettings extends SettingsPreferenceFragment } if (!mConnectDialogShowing) { - checkVpnConnectionStatus(); + // If mActiveProfile is not null but it's in IDLE state, then a + // retry dialog must be showing now as the previous connection + // attempt failed. In this case, don't call checkVpnConnectionStatus() + // as it will clean up mActiveProfile due to the IDLE state. + if ((mActiveProfile == null) + || (mActiveProfile.getState() != VpnState.IDLE)) { + checkVpnConnectionStatus(); + } } else { // Dismiss the connect dialog in case there is another instance // trying to operate a vpn connection.