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

Commit 0d8a53fa authored by Weng Su's avatar Weng Su
Browse files

[Provider Model] Fixed Internet Settings always showing "Loading"

- The Internet Settings will restart itself if it's launching in lock
screen

- The "Loading" might not be hidden if the activity restarts itself

- Move the postDelayed runnable from onViewCreated() to onStart() to
avoid loss

Bug: 204041345
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest

Change-Id: I516f1105c74b6c8853a72e71c20d2197495cc0d6
parent e535c2b6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -272,8 +272,6 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
        if (mWifiManager != null) {
            setLoading(true, false);
            mIsViewLoading = true;
            getView().postDelayed(mRemoveLoadingRunnable,
                    mWifiManager.isWifiEnabled() ? 1000 : 100);
        }
    }

@@ -431,6 +429,10 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
    @Override
    public void onStart() {
        super.onStart();
        if (mIsViewLoading) {
            final long delayMillis = mWifiManager.isWifiEnabled() ? 1000 : 100;
            getView().postDelayed(mRemoveLoadingRunnable, delayMillis);
        }
        if (mIsRestricted) {
            restrictUi();
            return;