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

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

[Manual Network Selection] UX improvement

Original design abort a network scan when screen off and restart scan
when screen on.

Under the situation of network scan time longer than screen off time,
user may not get any result but keeping in scanning screen.

This CL improve this situation by avoiding stop and rescan for the case
user didn't leave this UI and previous scan is in progressing.

Bug: 140448617
Test: Manual testing leave and back to UI, and screen off-on.
Change-Id: I74ffa574dac932ca7fcd76411cad4ec0cc88f25f
parent 0102d98d
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -135,6 +135,9 @@ public class NetworkSelectSettings extends DashboardFragment {
        super.onStart();

        updateForbiddenPlmns();
        if (isProgressBarVisible()) {
            return;
        }
        setProgressBarVisible(true);

        mNetworkScanHelper.startNetworkScan(
@@ -157,7 +160,6 @@ public class NetworkSelectSettings extends DashboardFragment {
    @Override
    public void onStop() {
        super.onStop();
        stopNetworkQuery();
    }

    @Override
@@ -377,6 +379,13 @@ public class NetworkSelectSettings extends DashboardFragment {
        mConnectedPreferenceCategory.setVisible(true);
    }

    private boolean isProgressBarVisible() {
        if (mProgressHeader == null) {
            return false;
        }
        return (mProgressHeader.getVisibility() == View.VISIBLE);
    }

    protected void setProgressBarVisible(boolean visible) {
        if (mProgressHeader != null) {
            mProgressHeader.setVisibility(visible ? View.VISIBLE : View.GONE);
@@ -425,6 +434,7 @@ public class NetworkSelectSettings extends DashboardFragment {

    @Override
    public void onDestroy() {
        stopNetworkQuery();
        mNetworkScanExecutor.shutdown();
        super.onDestroy();
    }