summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <ricardo@cyngn.com>2016-07-12 16:52:22 +0100
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2016-07-14 04:04:00 -0700
commit7c1cf5a2324b1622a12afa115bedd7a9c2031b0a (patch)
treeab3431f06a560548d394674408dd852ac26541b0
parent3ebea2fb6de5e6037255f97b5bf190a6e0b02c94 (diff)
downloadpackages_apps_SetupWizard-7c1cf5a2324b1622a12afa115bedd7a9c2031b0a.zip
packages_apps_SetupWizard-7c1cf5a2324b1622a12afa115bedd7a9c2031b0a.tar.gz
packages_apps_SetupWizard-7c1cf5a2324b1622a12afa115bedd7a9c2031b0a.tar.bz2
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
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/MobileDataPage.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/MobileDataPage.java b/src/com/cyanogenmod/setupwizard/setup/MobileDataPage.java
index da3872e..95d5912 100644
--- a/src/com/cyanogenmod/setupwizard/setup/MobileDataPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/MobileDataPage.java
@@ -142,7 +142,7 @@ public class MobileDataPage extends SetupPage {
boolean checked = !mEnableMobileData.isChecked();
SetupWizardUtils.setMobileDataEnabled(getActivity(), checked);
mEnableMobileData.setChecked(checked);
- if (checked) {
+ if (checked && !SetupWizardUtils.isWifiConnected(mContext)) {
waitForData();
} else {
onDataStateReady();
@@ -205,10 +205,14 @@ public class MobileDataPage extends SetupPage {
if (mTitleView != null) {
mTitleView.setText(mPage.getTitleResId());
}
- mProgressBar.setVisibility(View.INVISIBLE);
- mPageView.setVisibility(View.VISIBLE);
- mPageView.startAnimation(
- AnimationUtils.loadAnimation(getActivity(), R.anim.translucent_enter));
+ // Something else, like data enablement, may have grabbed
+ // the "hold" status. Kill it only if "Next" is active
+ if (mNextButton.isEnabled()) {
+ 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() {
mHandler.removeCallbacks(mDataConnectionReadyRunnable);
- if (getUserVisibleHint() && mProgressBar.isShown()) {
+ if ((getUserVisibleHint() && mProgressBar.isShown()) ||
+ !mNextButton.isEnabled()) {
mProgressBar.startAnimation(
AnimationUtils.loadAnimation(getActivity(), R.anim.translucent_exit));
mProgressBar.setVisibility(View.INVISIBLE);