diff options
author | Chung-yih Wang <cywang@google.com> | 2011-01-14 16:53:36 +0800 |
---|---|---|
committer | Chung-yih Wang <cywang@google.com> | 2011-01-14 16:53:36 +0800 |
commit | a256b7c3b499b1c4b8d18528cba997039359f343 (patch) | |
tree | c30ce6d2ca6ebe063b7d72b989987ac6e5c987a9 /src | |
parent | 6f8fb436178d12d11d6ab59671168f0603bdbdcb (diff) | |
download | packages_apps_Settings-a256b7c3b499b1c4b8d18528cba997039359f343.zip packages_apps_Settings-a256b7c3b499b1c4b8d18528cba997039359f343.tar.gz packages_apps_Settings-a256b7c3b499b1c4b8d18528cba997039359f343.tar.bz2 |
Fix the re-entrance of VpnSetting issue.
bug:3292801
Change-Id: I77c57d789754f175ce9e43ad77ff2edb711c2316
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/vpn/VpnSettings.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/settings/vpn/VpnSettings.java b/src/com/android/settings/vpn/VpnSettings.java index 0587619..960d37e 100644 --- a/src/com/android/settings/vpn/VpnSettings.java +++ b/src/com/android/settings/vpn/VpnSettings.java @@ -190,30 +190,38 @@ public class VpnSettings extends SettingsPreferenceFragment // for long-press gesture on a profile preference registerForContextMenu(getListView()); - // listen to vpn connectivity event - mVpnManager.registerConnectivityReceiver(mConnectivityReceiver); retrieveVpnListFromStorage(); - checkVpnConnectionStatusInBackground(); restoreInstanceState(savedInstanceState); } @Override + public void onPause() { + // ignore vpn connectivity event + mVpnManager.unregisterConnectivityReceiver(mConnectivityReceiver); + super.onPause(); + } + + @Override public void onResume() { super.onResume(); if (DEBUG) Log.d(TAG, "onResume"); + + // listen to vpn connectivity event + mVpnManager.registerConnectivityReceiver(mConnectivityReceiver); + if ((mUnlockAction != null) && isKeyStoreUnlocked()) { Runnable action = mUnlockAction; mUnlockAction = null; getActivity().runOnUiThread(action); } + checkVpnConnectionStatusInBackground(); } @Override public void onDestroyView() { unregisterForContextMenu(getListView()); - mVpnManager.unregisterConnectivityReceiver(mConnectivityReceiver); if ((mShowingDialog != null) && mShowingDialog.isShowing()) { mShowingDialog.dismiss(); } |