MobileData: Don't let wait-for-radio trample wait-for-data
Both waiting for radio and waiting for data used "is the progress bar visible" as the "allow to continue" clause. If radio service state changes arrived while the wait-for-data was ongoing, this'd terminate the progress bar and make it wait forever. Additionally, if wifi is connected, don't wait for data at all Ref CYNGNOS-3126 Change-Id: I81792ac8be00c6a6746af88a62220c727cddc6d8
This commit is contained in:
parent
3ebea2fb6d
commit
7c1cf5a232
@ -142,7 +142,7 @@ public class MobileDataPage extends SetupPage {
|
|||||||
boolean checked = !mEnableMobileData.isChecked();
|
boolean checked = !mEnableMobileData.isChecked();
|
||||||
SetupWizardUtils.setMobileDataEnabled(getActivity(), checked);
|
SetupWizardUtils.setMobileDataEnabled(getActivity(), checked);
|
||||||
mEnableMobileData.setChecked(checked);
|
mEnableMobileData.setChecked(checked);
|
||||||
if (checked) {
|
if (checked && !SetupWizardUtils.isWifiConnected(mContext)) {
|
||||||
waitForData();
|
waitForData();
|
||||||
} else {
|
} else {
|
||||||
onDataStateReady();
|
onDataStateReady();
|
||||||
@ -205,10 +205,14 @@ public class MobileDataPage extends SetupPage {
|
|||||||
if (mTitleView != null) {
|
if (mTitleView != null) {
|
||||||
mTitleView.setText(mPage.getTitleResId());
|
mTitleView.setText(mPage.getTitleResId());
|
||||||
}
|
}
|
||||||
mProgressBar.setVisibility(View.INVISIBLE);
|
// Something else, like data enablement, may have grabbed
|
||||||
mPageView.setVisibility(View.VISIBLE);
|
// the "hold" status. Kill it only if "Next" is active
|
||||||
mPageView.startAnimation(
|
if (mNextButton.isEnabled()) {
|
||||||
AnimationUtils.loadAnimation(getActivity(), R.anim.translucent_enter));
|
mProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
mPageView.setVisibility(View.VISIBLE);
|
||||||
|
mPageView.startAnimation(
|
||||||
|
AnimationUtils.loadAnimation(getActivity(), R.anim.translucent_enter));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,7 +229,8 @@ public class MobileDataPage extends SetupPage {
|
|||||||
|
|
||||||
private void onDataStateReady() {
|
private void onDataStateReady() {
|
||||||
mHandler.removeCallbacks(mDataConnectionReadyRunnable);
|
mHandler.removeCallbacks(mDataConnectionReadyRunnable);
|
||||||
if (getUserVisibleHint() && mProgressBar.isShown()) {
|
if ((getUserVisibleHint() && mProgressBar.isShown()) ||
|
||||||
|
!mNextButton.isEnabled()) {
|
||||||
mProgressBar.startAnimation(
|
mProgressBar.startAnimation(
|
||||||
AnimationUtils.loadAnimation(getActivity(), R.anim.translucent_exit));
|
AnimationUtils.loadAnimation(getActivity(), R.anim.translucent_exit));
|
||||||
mProgressBar.setVisibility(View.INVISIBLE);
|
mProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
Loading…
Reference in New Issue
Block a user