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

Commit 93dc6e7b authored by Amin Shaikh's avatar Amin Shaikh Committed by android-build-merger
Browse files

Merge "Merge "Only show mobile data turn off dialog once." into pi-dev am:...

Merge "Merge "Only show mobile data turn off dialog once." into pi-dev am: cb878721" into pi-dev-plus-aosp
am: 2c2f6b80

Change-Id: I0fa90b733c7e4935abe47b43cdf170cb69efb77c
parents 136976c6 2c2f6b80
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -108,20 +108,21 @@ public class CellularTile extends QSTileImpl<SignalState> {
        }
        if (mDataController.isMobileDataEnabled()) {
            if (mKeyguardMonitor.isSecure() && !mKeyguardMonitor.canSkipBouncer()) {
                mActivityStarter.postQSRunnableDismissingKeyguard(this::showDisableDialog);
                mActivityStarter.postQSRunnableDismissingKeyguard(this::maybeShowDisableDialog);
            } else {
                if (Prefs.getBoolean(mContext, QS_HAS_TURNED_OFF_MOBILE_DATA, false)) {
                    mDataController.setMobileDataEnabled(false);
                } else {
                    mUiHandler.post(this::showDisableDialog);
                }
                mUiHandler.post(this::maybeShowDisableDialog);
            }
        } else {
            mDataController.setMobileDataEnabled(true);
        }
    }

    private void showDisableDialog() {
    private void maybeShowDisableDialog() {
        if (Prefs.getBoolean(mContext, QS_HAS_TURNED_OFF_MOBILE_DATA, false)) {
            // Directly turn off mobile data if the user has seen the dialog before.
            mDataController.setMobileDataEnabled(false);
            return;
        }
        mHost.collapsePanels();
        String carrierName = mController.getMobileDataNetworkName();
        if (TextUtils.isEmpty(carrierName)) {