SetupWizard: Catch case where restore activity not found
Change-Id: I4acd9c2779fc41f087942e37647f90b47d3f3d9a
This commit is contained in:
parent
7970c9b351
commit
6f1d19f572
@ -36,6 +36,7 @@ import android.provider.Settings;
|
|||||||
import com.cyanogenmod.setupwizard.R;
|
import com.cyanogenmod.setupwizard.R;
|
||||||
import com.cyanogenmod.setupwizard.SetupWizardApp;
|
import com.cyanogenmod.setupwizard.SetupWizardApp;
|
||||||
import com.cyanogenmod.setupwizard.ui.LoadingFragment;
|
import com.cyanogenmod.setupwizard.ui.LoadingFragment;
|
||||||
|
import com.cyanogenmod.setupwizard.ui.SetupWizardActivity;
|
||||||
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
|
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -144,18 +145,25 @@ public class GmsAccountPage extends SetupPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void launchGmsRestorePage(final Activity activity) {
|
private static void launchGmsRestorePage(final Activity activity) {
|
||||||
Intent intent = new Intent(ACTION_RESTORE);
|
try {
|
||||||
intent.putExtra(SetupWizardApp.EXTRA_ALLOW_SKIP, true);
|
Intent intent = new Intent(ACTION_RESTORE);
|
||||||
intent.putExtra(SetupWizardApp.EXTRA_USE_IMMERSIVE, true);
|
intent.putExtra(SetupWizardApp.EXTRA_ALLOW_SKIP, true);
|
||||||
intent.putExtra(SetupWizardApp.EXTRA_FIRST_RUN, true);
|
intent.putExtra(SetupWizardApp.EXTRA_USE_IMMERSIVE, true);
|
||||||
intent.putExtra(SetupWizardApp.EXTRA_THEME, SetupWizardApp.EXTRA_MATERIAL_LIGHT);
|
intent.putExtra(SetupWizardApp.EXTRA_FIRST_RUN, true);
|
||||||
ActivityOptions options =
|
intent.putExtra(SetupWizardApp.EXTRA_THEME, SetupWizardApp.EXTRA_MATERIAL_LIGHT);
|
||||||
ActivityOptions.makeCustomAnimation(activity,
|
ActivityOptions options =
|
||||||
android.R.anim.fade_in,
|
ActivityOptions.makeCustomAnimation(activity,
|
||||||
android.R.anim.fade_out);
|
android.R.anim.fade_in,
|
||||||
activity.startActivityForResult(
|
android.R.anim.fade_out);
|
||||||
intent,
|
activity.startActivityForResult(
|
||||||
SetupWizardApp.REQUEST_CODE_RESTORE_GMS, options.toBundle());
|
intent,
|
||||||
|
SetupWizardApp.REQUEST_CODE_RESTORE_GMS, options.toBundle());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
// XXX: In open source, we don't know what gms version a user has.
|
||||||
|
// Bail if the restore activity is not found.
|
||||||
|
((SetupWizardActivity)activity).onNextPage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void launchGmsAccountSetup(final Activity activity) {
|
private void launchGmsAccountSetup(final Activity activity) {
|
||||||
|
Loading…
Reference in New Issue
Block a user