Fix alert dialogs in VpnSettings.
+ Don't check mDialogFragment.isVisible() in SettingsPreferenceFragment.removeDialog() as mDialogFragment may not be visible in parent fragment's onResume(). + Replace mConnectDialog with mConnectDialogShowing and remove removeConnectDialog(). + Dismiss alert dialogs in onPause() so that we don't need to maintain extra states during pause-resume cycle. In addition, fix a NPE when startVpnTypeSelection(). Bug: 3381434 Bug: 3289365 Change-Id: Ic4aa87c7a618d95e86e45d6617f2ad7dab35f019
This commit is contained in:
@@ -105,8 +105,10 @@ public class SettingsPreferenceFragment extends PreferenceFragment
|
||||
}
|
||||
|
||||
protected void removeDialog(int dialogId) {
|
||||
if (mDialogFragment != null && mDialogFragment.getDialogId() == dialogId
|
||||
&& mDialogFragment.isVisible()) {
|
||||
// mDialogFragment may not be visible yet in parent fragment's onResume().
|
||||
// To be able to dismiss dialog at that time, don't check
|
||||
// mDialogFragment.isVisible().
|
||||
if (mDialogFragment != null && mDialogFragment.getDialogId() == dialogId) {
|
||||
mDialogFragment.dismiss();
|
||||
}
|
||||
mDialogFragment = null;
|
||||
|
Reference in New Issue
Block a user