diff options
author | cretin45 <cretin45@gmail.com> | 2015-02-10 12:28:55 -0800 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2015-02-10 12:30:45 -0800 |
commit | 953156f3712dc65faff782fec085d3ffebc0bc52 (patch) | |
tree | 7fa9ab5a27bfa25e9b65e17d380dd0616fda6aa9 | |
parent | a6b56dd6f67818f9254fd39a4ec0619b511a20c1 (diff) | |
download | packages_apps_SetupWizard-953156f3712dc65faff782fec085d3ffebc0bc52.zip packages_apps_SetupWizard-953156f3712dc65faff782fec085d3ffebc0bc52.tar.gz packages_apps_SetupWizard-953156f3712dc65faff782fec085d3ffebc0bc52.tar.bz2 |
SetupWizard: Pretend to be the gms wizardmanager for restore page
Change-Id: I9376ed55cbb4f8cc176a2f2bb9a493fe023841a0
-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 6f4c04b..8ebfb2c 100644 --- a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java @@ -48,6 +48,8 @@ public class GmsAccountPage extends SetupPage { public static final String TAG = "GmsAccountPage"; public static final String ACTION_RESTORE = "com.google.android.setupwizard.RESTORE"; + private static final String RESTORE_WIZARD_SCRIPT = + "android.resource://com.google.android.setupwizard/xml/wizard_script"; private ContentQueryMap mContentQueryMap; private Observer mSettingsObserver; @@ -114,7 +116,7 @@ public class GmsAccountPage extends SetupPage { @Override public boolean onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == SetupWizardApp.REQUEST_CODE_SETUP_GMS) { - if (!mBackupEnabled) { + if (!mBackupEnabled && SetupWizardUtils.isOwner() && resultCode == Activity.RESULT_OK) { launchGmsRestorePage((Activity) mContext); } else { handleResult(resultCode); @@ -151,6 +153,9 @@ public class GmsAccountPage extends SetupPage { intent.putExtra(SetupWizardApp.EXTRA_USE_IMMERSIVE, true); intent.putExtra(SetupWizardApp.EXTRA_FIRST_RUN, true); intent.putExtra(SetupWizardApp.EXTRA_THEME, SetupWizardApp.EXTRA_MATERIAL_LIGHT); + // XXX: Fool G's setup wizard into thinking it is their setup wizard. + // This is necessary to get the material theme on the restore page. + intent.putExtra("scriptUri", RESTORE_WIZARD_SCRIPT); ActivityOptions options = ActivityOptions.makeCustomAnimation(activity, android.R.anim.fade_in, |