[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
This commit is contained in:
@@ -272,8 +272,6 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
|
|||||||
if (mWifiManager != null) {
|
if (mWifiManager != null) {
|
||||||
setLoading(true, false);
|
setLoading(true, false);
|
||||||
mIsViewLoading = true;
|
mIsViewLoading = true;
|
||||||
getView().postDelayed(mRemoveLoadingRunnable,
|
|
||||||
mWifiManager.isWifiEnabled() ? 1000 : 100);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,6 +429,10 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
if (mIsViewLoading) {
|
||||||
|
final long delayMillis = mWifiManager.isWifiEnabled() ? 1000 : 100;
|
||||||
|
getView().postDelayed(mRemoveLoadingRunnable, delayMillis);
|
||||||
|
}
|
||||||
if (mIsRestricted) {
|
if (mIsRestricted) {
|
||||||
restrictUi();
|
restrictUi();
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user