From 36f15ef1691e93b23e7d73cd8da110256d69c7a0 Mon Sep 17 00:00:00 2001 From: cretin45 Date: Fri, 13 May 2016 15:34:56 -0700 Subject: [PATCH] SetupWizard: Alway show google pages if gms present Helps with an issue where qsb widget doesn't work when running through oobe without network. Also set the cm setup finished setting for test receiver. CYNGNOS-2833 Change-Id: I83666deea5a27d74669691c4ab991b1b618edb0a --- .../setupwizard/setup/CMSetupWizardData.java | 17 ++++------------- .../setupwizard/setup/FinishSetupReceiver.java | 2 ++ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java index b4cba65..86cabd4 100644 --- a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java +++ b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java @@ -64,8 +64,9 @@ public class CMSetupWizardData extends AbstractSetupData { pages.add(new MobileDataPage(mContext, this) .setHidden(!isSimInserted() || mMobileDataEnabled)); } - if (SetupWizardUtils.hasGMS(mContext)) { - pages.add(new GmsAccountPage(mContext, this).setHidden(true)); + final boolean hasGMS = SetupWizardUtils.hasGMS(mContext); + if (hasGMS) { + pages.add(new GmsAccountPage(mContext, this)); } if (!SetupWizardUtils.hasLeanback(mContext) && SetupWizardUtils.isPackageInstalled(mContext, @@ -76,7 +77,7 @@ public class CMSetupWizardData extends AbstractSetupData { pages.add(new FingerprintSetupPage(mContext, this)); } pages.add(new CyanogenSettingsPage(mContext, this)); - pages.add(new OtherSettingsPage(mContext, this)); + pages.add(new OtherSettingsPage(mContext, this).setHidden(!hasGMS)); pages.add(new DateTimePage(mContext, this)); pages.add(new FinishPage(mContext, this)); return new PageList(pages.toArray(new SetupPage[pages.size()])); @@ -111,16 +112,6 @@ public class CMSetupWizardData extends AbstractSetupData { private void showHideAccountPages() { boolean isConnected = SetupWizardUtils.isNetworkConnected(mContext); - GmsAccountPage gmsAccountPage = - (GmsAccountPage) getPage(GmsAccountPage.TAG); - OtherSettingsPage otherSettingsPage = (OtherSettingsPage) getPage(OtherSettingsPage.TAG); - if (gmsAccountPage != null) { - boolean hidden = !isConnected && gmsAccountPage.canSkip(); - gmsAccountPage.setHidden(hidden); - if (otherSettingsPage != null) { - otherSettingsPage.setHidden(!hidden); - } - } CyanogenServicesPage cyanogenServicesPage = (CyanogenServicesPage) getPage(CyanogenServicesPage.TAG); if (cyanogenServicesPage != null) { diff --git a/src/com/cyanogenmod/setupwizard/setup/FinishSetupReceiver.java b/src/com/cyanogenmod/setupwizard/setup/FinishSetupReceiver.java index d3db8ff..ee881a9 100644 --- a/src/com/cyanogenmod/setupwizard/setup/FinishSetupReceiver.java +++ b/src/com/cyanogenmod/setupwizard/setup/FinishSetupReceiver.java @@ -23,6 +23,8 @@ public class FinishSetupReceiver extends BroadcastReceiver { StatusBarManager.DISABLE_NONE); Settings.Global.putInt(context.getContentResolver(), SetupWizardApp.KEY_DETECT_CAPTIVE_PORTAL, 1); + cyanogenmod.providers.CMSettings.Secure.putInt(context.getContentResolver(), + cyanogenmod.providers.CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED, 1); SetupWizardUtils.disableGMSSetupWizard(context); SetupWizardUtils.disableSetupWizard(context); }