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
(cherry picked from commit 36f15ef169)
This commit is contained in:
cretin45
2016-05-13 15:34:56 -07:00
committed by Gerrit Code Review
parent 48edca790e
commit c797d1f5ef
2 changed files with 6 additions and 13 deletions

View File

@@ -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) {

View File

@@ -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);
}