[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
This commit is contained in:
Bonian Chen
2019-09-25 18:37:12 +08:00
parent 0102d98dc9
commit cbb446e38a

View File

@@ -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();
}