Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec3264f8 authored by Bonian Chen's avatar Bonian Chen
Browse files

[Settings] Stop listening data connected intent for presenting reset APN dialog

Suspening the monitering of intent(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)
during the stage of resetting default APN, since its more like a noice
once the reset progress stared (since user pressed the menu button).

Bug: 190127964
Test: local
Change-Id: I524fb4a3b06b50706556b8e68cb36dc5efbd9a07
parent 8f463f5c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -467,6 +467,9 @@ public class ApnSettings extends RestrictedSettingsFragment
    }

    private boolean restoreDefaultApn() {
        // Callback of data connection change could be some noise during the stage of restore.
        mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);

        showDialog(DIALOG_RESTORE_DEFAULTAPN);
        mRestoreDefaultApnMode = true;

@@ -517,6 +520,7 @@ public class ApnSettings extends RestrictedSettingsFragment
                        getResources().getString(
                                R.string.restore_default_apn_completed),
                        Toast.LENGTH_LONG).show();
                    restartPhoneStateListener(mSubId);
                    break;
            }
        }