diff options
author | Ricardo Cerqueira <ricardo@cyngn.com> | 2016-10-25 23:25:38 +0100 |
---|---|---|
committer | Ricardo Cerqueira <ricardo@cyngn.com> | 2016-10-25 23:42:58 +0100 |
commit | d82b2dc88a8a7ef5224ca20529e4288f7d2fc913 (patch) | |
tree | b34a1c5ddf1250b594e150c7a50b8c30dd463c7c | |
parent | cca206faa1a057cbb75e1648339091d9ea81ff21 (diff) | |
download | packages_apps_SetupWizard-d82b2dc88a8a7ef5224ca20529e4288f7d2fc913.zip packages_apps_SetupWizard-d82b2dc88a8a7ef5224ca20529e4288f7d2fc913.tar.gz packages_apps_SetupWizard-d82b2dc88a8a7ef5224ca20529e4288f7d2fc913.tar.bz2 |
GmsAccount: If there's no network and FRP isn't enforcing, skip GMS
The current version of GMS's SuW has the main activity return as
CANCELED when no network is available. This is the same result as
an actual cancellation (by pressing "Back"), and there's no extra
data to distinguish the two, so the user gets stuck in a loop between
the "no network" page and the one preceding it, unless connectivity
is somehow established. Making connectivity mandatory for OOBE isn't
acceptable, so skip GMS entirely if network is absent (and FRP
isn't enforcing). The only thing it was presenting was a "you
have no network" dialog anyway.
Change-Id: I2abadc79a0823e94da7d3a875ce6db8eae8f143b
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java index 2b4741a..436da08 100644 --- a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java @@ -102,7 +102,12 @@ public class GmsAccountPage extends SetupPage { getCallbacks().onPreviousPage(); } else { super.doLoadAction(fragmentManager, action); - if (!SetupWizardUtils.accountExists(mContext, SetupWizardApp.ACCOUNT_TYPE_GMS)) { + if (!SetupWizardUtils.isNetworkConnected(mContext) && !SetupWizardUtils.frpEnabled(mContext)) { + if (SetupWizardApp.DEBUG) { + Log.d(TAG, "No network, no FRP enforcement, skip GMS account"); + } + getCallbacks().onNextPage(); + } else if (!SetupWizardUtils.accountExists(mContext, SetupWizardApp.ACCOUNT_TYPE_GMS)) { launchGmsAccountSetup(); } else { // This can happen if the user goes from setup -> restore, but chooses to set |