SetupWizard: Fix double advance after adding account

Change-Id: I039f0c290c4ef539df16374cb1e6f2e7b49e41cd
This commit is contained in:
cretin45 2015-01-23 17:13:45 -08:00
parent dc8c56ba31
commit b7e0ddb233
3 changed files with 5 additions and 15 deletions

View File

@ -76,7 +76,10 @@ public class CyanogenServicesPage extends SetupPage {
if (action == Page.ACTION_PREVIOUS) { if (action == Page.ACTION_PREVIOUS) {
getCallbacks().onPreviousPage(); getCallbacks().onPreviousPage();
} else { } else {
launchCyanogenAccountSetup(context); if (!SetupWizardUtils.accountExists(mContext,
mContext.getString(R.string.cm_account_type))) {
launchCyanogenAccountSetup(context);
}
super.doLoadAction(context, action); super.doLoadAction(context, action);
} }
} }

View File

@ -20,7 +20,6 @@ import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.app.FragmentManager; import android.app.FragmentManager;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@ -38,7 +37,6 @@ import android.widget.CheckBox;
import android.widget.TextView; import android.widget.TextView;
import com.cyanogenmod.setupwizard.R; import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment; import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import com.cyanogenmod.setupwizard.ui.WebViewDialogFragment; import com.cyanogenmod.setupwizard.ui.WebViewDialogFragment;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils; import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@ -50,7 +48,7 @@ import org.cyanogenmod.hardware.KeyDisabler;
public class CyanogenSettingsPage extends SetupPage { public class CyanogenSettingsPage extends SetupPage {
public static final String TAG = "CyanogenServicesPage"; public static final String TAG = "CyanogenSettingsPage";
public static final String KEY_SEND_METRICS = "send_metrics"; public static final String KEY_SEND_METRICS = "send_metrics";
public static final String KEY_REGISTER_WHISPERPUSH = "register"; public static final String KEY_REGISTER_WHISPERPUSH = "register";
@ -85,16 +83,6 @@ public class CyanogenSettingsPage extends SetupPage {
return R.string.setup_services; return R.string.setup_services;
} }
@Override
public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == SetupWizardApp.REQUEST_CODE_SETUP_CYANOGEN) {
if (resultCode == Activity.RESULT_CANCELED) {
getCallbacks().onPreviousPage();
}
}
return true;
}
private static void writeDisableNavkeysOption(Context context, boolean enabled) { private static void writeDisableNavkeysOption(Context context, boolean enabled) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
final int defaultBrightness = context.getResources().getInteger( final int defaultBrightness = context.getResources().getInteger(

View File

@ -113,7 +113,6 @@ public abstract class SetupPage implements Page {
@Override @Override
public void setCompleted(boolean completed) { public void setCompleted(boolean completed) {
mCompleted = completed; mCompleted = completed;
mCallbacks.onNextPage();
} }
@Override @Override