diff options
author | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-08-10 13:07:37 +0100 |
---|---|---|
committer | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-08-10 13:21:01 +0100 |
commit | 649a5ec162a8cc6ef5840ce11fe7e35156d1bdf3 (patch) | |
tree | 7fcc3090f89eff0d873bb6425288504b8f9ecdea /src/com/cyanogenmod/setupwizard/setup | |
parent | d587f56e2e04a11271407a127f92d205a018e078 (diff) | |
download | packages_apps_SetupWizard-649a5ec162a8cc6ef5840ce11fe7e35156d1bdf3.zip packages_apps_SetupWizard-649a5ec162a8cc6ef5840ce11fe7e35156d1bdf3.tar.gz packages_apps_SetupWizard-649a5ec162a8cc6ef5840ce11fe7e35156d1bdf3.tar.bz2 |
SetupWizard: Adjust FRP-enforcing logic
* Always pass ALLOW_SKIP to GMS, it's smart enough to know when it
can't be applied.
* Don't bring up the authentication screen if no-network and canSkip
Still CYNGNOS-707
Change-Id: Ia1a81c4443cfd5bc3c3e5fd84758ff0ba2a2a140
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java | 8 | ||||
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java index 2fc5729..9d1332d 100644 --- a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java +++ b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java @@ -64,7 +64,7 @@ public class CMSetupWizardData extends AbstractSetupData { .setHidden(!isSimInserted() || mMobileDataEnabled)); } if (SetupWizardUtils.hasGMS(mContext)) { - pages.add(new GmsAccountPage(mContext, this)); + pages.add(new GmsAccountPage(mContext, this).setHidden(true)); } if (!SetupWizardUtils.hasLeanback(mContext)) { pages.add(new CyanogenServicesPage(mContext, this).setHidden(true)); @@ -109,7 +109,11 @@ public class CMSetupWizardData extends AbstractSetupData { private void showHideAccountPages() { boolean isConnected = SetupWizardUtils.isNetworkConnected(mContext); - + GmsAccountPage gmsAccountPage = + (GmsAccountPage) getPage(GmsAccountPage.TAG); + if (gmsAccountPage != null) { + gmsAccountPage.setHidden(!isConnected && gmsAccountPage.canSkip()); + } CyanogenServicesPage cyanogenServicesPage = (CyanogenServicesPage) getPage(CyanogenServicesPage.TAG); if (cyanogenServicesPage != null) { diff --git a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java index c5c4710..205e0c8 100644 --- a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java @@ -211,9 +211,10 @@ public class GmsAccountPage extends SetupPage { } } - private boolean canSkip() { + public boolean canSkip() { final PersistentDataBlockManager pdbManager = (PersistentDataBlockManager) mContext.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE); + Log.d(TAG,"GMS skip: OEM unlock is enabled: " + pdbManager.getOemUnlockEnabled() + " and amount of PST blocks is " + pdbManager.getDataBlockSize()); return pdbManager == null || pdbManager.getDataBlockSize() == 0 || pdbManager.getOemUnlockEnabled(); @@ -222,7 +223,7 @@ public class GmsAccountPage extends SetupPage { private void launchGmsAccountSetup() { Bundle bundle = new Bundle(); bundle.putBoolean(SetupWizardApp.EXTRA_FIRST_RUN, true); - bundle.putBoolean(SetupWizardApp.EXTRA_ALLOW_SKIP, canSkip()); + bundle.putBoolean(SetupWizardApp.EXTRA_ALLOW_SKIP, true); bundle.putBoolean(SetupWizardApp.EXTRA_USE_IMMERSIVE, true); AccountManager .get(mContext).addAccount(SetupWizardApp.ACCOUNT_TYPE_GMS, null, null, |