From 744827989c78d85bb7874cefc606b39d8647c351 Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Wed, 16 Mar 2016 17:09:49 -0700 Subject: [PATCH] SetupWizard: Adapt to new GMS tap & go expectations. Googles SetupWizard expects a specific flow for the restoration process -- amend the intent for gms restore to abide. Change-Id: Idf4c3b813676c5456770627067a42697ab756bb0 TICKET: CYNGNOS-2233 --- src/com/cyanogenmod/setupwizard/SetupWizardApp.java | 2 ++ .../cyanogenmod/setupwizard/setup/GmsAccountPage.java | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/com/cyanogenmod/setupwizard/SetupWizardApp.java b/src/com/cyanogenmod/setupwizard/SetupWizardApp.java index cdcfcf8..9651f07 100644 --- a/src/com/cyanogenmod/setupwizard/SetupWizardApp.java +++ b/src/com/cyanogenmod/setupwizard/SetupWizardApp.java @@ -53,6 +53,8 @@ public class SetupWizardApp extends Application { public static final String EXTRA_LOGIN_FOR_KILL_SWITCH = "authCks"; public static final String EXTRA_TITLE = "title"; public static final String EXTRA_DETAILS = "details"; + public static final String EXTRA_FRAGMENT = "fragment"; + public static final String EXTRA_ACTION_ID = "actionId"; public static final String KEY_DETECT_CAPTIVE_PORTAL = "captive_portal_detection_enabled"; diff --git a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java index 2fc1243..7c33328 100644 --- a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java @@ -28,6 +28,7 @@ import android.app.FragmentManager; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; import android.database.ContentObserver; import android.os.Bundle; import android.os.Handler; @@ -47,7 +48,11 @@ public class GmsAccountPage extends SetupPage { public static final String TAG = "GmsAccountPage"; - public static final String ACTION_RESTORE = "com.google.android.setupwizard.RESTORE"; + public static final String ACTION_PROGRESS = "com.google.android.setupwizard.PROGRESS"; + public static final String RESTORE_ACTION_ID = "mfm_restore_start"; + public static final String FRAGMENT_START_RESTORE = + "com.google.android.setupwizard.account.StartRestoreFragment"; + private static final String RESTORE_WIZARD_SCRIPT = "android.resource://com.google.android.setupwizard/xml/wizard_script"; @@ -176,7 +181,9 @@ public class GmsAccountPage extends SetupPage { try { // GMS can disable this after logging in sometimes if (SetupWizardUtils.enableGMSSetupWizard(mContext)) { - Intent intent = new Intent(ACTION_RESTORE); + Intent intent = new Intent(ACTION_PROGRESS); + intent.putExtra(SetupWizardApp.EXTRA_FRAGMENT, FRAGMENT_START_RESTORE); + intent.putExtra(SetupWizardApp.EXTRA_ACTION_ID, RESTORE_ACTION_ID); intent.putExtra(SetupWizardApp.EXTRA_ALLOW_SKIP, true); intent.putExtra(SetupWizardApp.EXTRA_USE_IMMERSIVE, true); intent.putExtra(SetupWizardApp.EXTRA_FIRST_RUN, true);