Merge "Fix the re-entrance of VpnSetting issue." into honeycomb
This commit is contained in:
committed by
Android (Google) Code Review
commit
80ca289b64
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user