Files
firefox/mobile/android/base/sync/delegates/BaseGlobalSessionCallback.java
T
Nick Alexander 7417a119cb Bug 956444 - Migrate from Old Sync to Firefox Accounts based on meta/fxa_credentials migration sentinel. r=rnewman
========

https://github.com/mozilla-services/android-sync/commit/5dec5a7929c418153846ea1dce3dc00a4ef75cb6
Author: Nick Alexander <[email protected]>
Date:   Wed Dec 17 18:03:44 2014 -0800

    Bug 956444 - Post: Persist fetch timestamp on 404.

    I imported and modified your old code; this looks like an oversight from
    there, but I want to call it out.  If we don't persist the timestamp,
    then the stamp persisted to config is always -1, meaning we GET (and
    404) the credentials on every sync.  You have code to compare
    info/collections against the fetched timestamp so I think we should
    persist even on 404.

========

https://github.com/mozilla-services/android-sync/commit/520341ce660c332626064087c0d8a6de0f36b8ce
Author: Richard Newman <[email protected]>
Date:   Thu Jan 2 20:44:58 2014 -0800

    Bug 956444 - Part 2: Fetch and process meta/fxa_credentials migration sentinel.

    This adds a Sync stage that tries to create a new Firefox Account in the
    MigratedFromSync11 state when a known migration sentinel is seen.

========

https://github.com/mozilla-services/android-sync/commit/2f4ea5c14b96c95564f0cc4a0d7241767bf0c15b
Author: Nick Alexander <[email protected]>
Date:   Fri Dec 12 16:44:25 2014 -0800

    Bug 956444 - Part 1: Add informMigrated callback.

    GlobalSession and Sync stages don't have access to the Android Account
    object.  This callback maintains the existing information hiding.

========

https://github.com/mozilla-services/android-sync/commit/11a8f6c1ef23580e6a61759bda909e86b588c040
Author: Nick Alexander <[email protected]>
Date:   Fri Dec 12 16:26:02 2014 -0800

    Bug 956444 - Pre: Unpickle accounts during package upgrade.

    This makes it a little easier to test: you can |adb push| or |adb shell
    echo ''| a known sync.accounts.json file onto device and then re-install
    the package to restore a known Sync Account.
2015-01-05 13:50:08 -08:00

50 lines
1.6 KiB
Java

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.sync.delegates;
import java.net.URI;
import org.mozilla.gecko.sync.GlobalSession;
import org.mozilla.gecko.sync.stage.GlobalSyncStage.Stage;
public interface BaseGlobalSessionCallback {
/**
* Request that no further syncs occur within the next `backoff` milliseconds.
* @param backoff a duration in milliseconds.
*/
void requestBackoff(long backoff);
/**
* Called on a 401 HTTP response.
*/
void informUnauthorizedResponse(GlobalSession globalSession, URI oldClusterURL);
/**
* Called when an HTTP failure indicates that a software upgrade is required.
*/
void informUpgradeRequiredResponse(GlobalSession session);
/**
* Called when a migration sentinel has been found and processed successfully.
* <p>
* This account should stop syncing immediately, and arrange to delete itself.
*/
void informMigrated(GlobalSession session);
void handleAborted(GlobalSession globalSession, String reason);
void handleError(GlobalSession globalSession, Exception ex);
void handleSuccess(GlobalSession globalSession);
void handleStageCompleted(Stage currentState, GlobalSession globalSession);
/**
* Called when a {@link GlobalSession} wants to know if it should continue
* to make storage requests.
*
* @return false if the session should make no further requests.
*/
boolean shouldBackOffStorage();
}