Bug 709339 - First mostly functional drop of native Sync. a=mobile

This commit is contained in:
Richard Newman
2012-01-14 09:20:31 -08:00
parent 83e8e5d5ed
commit 5fe8ffe843
89 changed files with 5497 additions and 2295 deletions

View File

@@ -37,6 +37,7 @@
package org.mozilla.gecko.sync.synchronizer;
import org.mozilla.gecko.sync.SynchronizerConfiguration;
import org.mozilla.gecko.sync.repositories.Repository;
import org.mozilla.gecko.sync.repositories.RepositorySessionBundle;
@@ -77,10 +78,17 @@ public class Synchronizer {
}
@Override
public void onSynchronized(SynchronizerSession session) {
public void onSynchronized(SynchronizerSession synchronizerSession) {
Log.d(LOG_TAG, "Got onSynchronized.");
Log.d(LOG_TAG, "Notifying SynchronizerDelegate.");
this.synchronizerDelegate.onSynchronized(session.getSynchronizer());
this.synchronizerDelegate.onSynchronized(synchronizerSession.getSynchronizer());
}
@Override
public void onSynchronizeSkipped(SynchronizerSession synchronizerSession) {
Log.d(LOG_TAG, "Got onSynchronizeSkipped.");
Log.d(LOG_TAG, "Notifying SynchronizerDelegate as if on success.");
this.synchronizerDelegate.onSynchronized(synchronizerSession.getSynchronizer());
}
@Override
@@ -123,4 +131,16 @@ public class Synchronizer {
SynchronizerSession session = new SynchronizerSession(this, sessionDelegate);
session.init(context, bundleA, bundleB);
}
public SynchronizerConfiguration save() {
String syncID = null; // TODO: syncID.
return new SynchronizerConfiguration(syncID, bundleA, bundleB);
}
// Not thread-safe.
public void load(SynchronizerConfiguration config) {
bundleA = config.remoteBundle;
bundleB = config.localBundle;
// TODO: syncID.
}
}