Bug 1017142 - Show old Sync users their synced tabs instead of new sync setup in remote tabs panel. r=nalexander

This commit is contained in:
Michael Comella 2014-05-28 14:10:18 -07:00
parent 952d00602c
commit ee3e698443

View File

@ -5,9 +5,9 @@
package org.mozilla.gecko.tabspanel;
import org.mozilla.gecko.R;
import org.mozilla.gecko.fxa.FirefoxAccounts;
import org.mozilla.gecko.fxa.login.State;
import org.mozilla.gecko.sync.setup.SyncAccounts;
import org.mozilla.gecko.tabspanel.TabsPanel.PanelView;
import android.content.Context;
@ -79,10 +79,17 @@ class RemoteTabsPanel extends FrameLayout implements PanelView {
}
private RemotePanelType getPanelTypeFromAccountState() {
final State accountState = FirefoxAccounts.getFirefoxAccountState(getContext());
final Context context = getContext();
final State accountState = FirefoxAccounts.getFirefoxAccountState(context);
if (accountState == null) {
// If old Sync exists, we want to show their synced tabs,
// rather than the new Sync setup screen.
if (SyncAccounts.syncAccountsExist(context)) {
return RemotePanelType.CONTAINER;
} else {
return RemotePanelType.SETUP;
}
}
if (accountState.getNeededAction() == State.Action.NeedsVerification) {
return RemotePanelType.VERIFICATION;