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

Commit 0601fd24 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix flicker of internet dialog." into main

parents ca2f7297 fdbd1226
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -306,6 +306,8 @@ public class InternetDialogDelegate implements
                mInternetDialogController.isAirplaneModeEnabled() ? View.VISIBLE : View.GONE);
        mWifiRecyclerView.setLayoutManager(new LinearLayoutManager(context));
        mWifiRecyclerView.setAdapter(mAdapter);

        updateDialogUI(getWifiNetworkContent());
    }

    @Override
@@ -315,6 +317,7 @@ public class InternetDialogDelegate implements
        }

        mLifecycleRegistry.setCurrentState(Lifecycle.State.RESUMED);

        mInternetDialogController.onStart(this, mCanConfigWifi);
        if (!mCanConfigWifi) {
            hideWifiViews();
@@ -402,10 +405,12 @@ public class InternetDialogDelegate implements
        internetContent.mShouldUpdateMobileNetwork = shouldUpdateMobileNetwork;
        internetContent.mInternetDialogTitleString = getDialogTitleText();
        internetContent.mInternetDialogSubTitle = getSubtitleText();
        if (shouldUpdateMobileNetwork) {
            internetContent.mActiveNetworkIsCellular =
                    mInternetDialogController.activeNetworkIsCellular();
            internetContent.mIsCarrierNetworkActive =
                    mInternetDialogController.isCarrierNetworkActive();
        }
        internetContent.mIsAirplaneModeEnabled = mInternetDialogController.isAirplaneModeEnabled();
        internetContent.mHasEthernet = mInternetDialogController.hasEthernet();
        internetContent.mIsWifiEnabled = mInternetDialogController.isWifiEnabled();
@@ -416,6 +421,15 @@ public class InternetDialogDelegate implements
        return internetContent;
    }

    private InternetContent getWifiNetworkContent() {
        InternetContent internetContent = new InternetContent();
        internetContent.mInternetDialogTitleString = getDialogTitleText();
        internetContent.mInternetDialogSubTitle = getSubtitleText();
        internetContent.mIsWifiEnabled = mInternetDialogController.isWifiEnabled();
        internetContent.mIsDeviceLocked = mInternetDialogController.isDeviceLocked();
        return internetContent;
    }

    private void setOnClickListener(SystemUIDialog dialog) {
        mMobileNetworkLayout.setOnClickListener(v -> {
            int autoSwitchNonDdsSubId = mInternetDialogController.getActiveAutoSwitchNonDdsSubId();