OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.sync; | 5 package org.chromium.chrome.browser.sync; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.util.Log; | 8 import android.util.Log; |
9 | 9 |
10 import com.google.common.annotations.VisibleForTesting; | 10 import com.google.common.annotations.VisibleForTesting; |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 /** | 494 /** |
495 * Returns the time when the last sync cycle was completed. | 495 * Returns the time when the last sync cycle was completed. |
496 * | 496 * |
497 * @return The difference measured in microseconds, between last sync cycle
completion time | 497 * @return The difference measured in microseconds, between last sync cycle
completion time |
498 * and 1 January 1970 00:00:00 UTC. | 498 * and 1 January 1970 00:00:00 UTC. |
499 */ | 499 */ |
500 public long getLastSyncedTimeForTest() { | 500 public long getLastSyncedTimeForTest() { |
501 return nativeGetLastSyncedTimeForTest(mNativeProfileSyncServiceAndroid); | 501 return nativeGetLastSyncedTimeForTest(mNativeProfileSyncServiceAndroid); |
502 } | 502 } |
503 | 503 |
| 504 /** |
| 505 * Overrides the Sync engine's NetworkResources. This is used to set up the
Sync FakeServer for |
| 506 * testing. |
| 507 * |
| 508 * @param networkResources the pointer to the NetworkResources created by th
e native code. It |
| 509 * is assumed that the Java caller has ownership of
this pointer; |
| 510 * ownership is transferred as part of this call. |
| 511 */ |
| 512 public void overrideNetworkResourcesForTest(long networkResources) { |
| 513 nativeOverrideNetworkResourcesForTest(mNativeProfileSyncServiceAndroid,
networkResources); |
| 514 } |
| 515 |
504 // Native methods | 516 // Native methods |
505 private native void nativeNudgeSyncer( | 517 private native void nativeNudgeSyncer( |
506 long nativeProfileSyncServiceAndroid, int objectSource, String objec
tId, long version, | 518 long nativeProfileSyncServiceAndroid, int objectSource, String objec
tId, long version, |
507 String payload); | 519 String payload); |
508 private native void nativeNudgeSyncerForAllTypes(long nativeProfileSyncServi
ceAndroid); | 520 private native void nativeNudgeSyncerForAllTypes(long nativeProfileSyncServi
ceAndroid); |
509 private native long nativeInit(); | 521 private native long nativeInit(); |
510 private native void nativeEnableSync(long nativeProfileSyncServiceAndroid); | 522 private native void nativeEnableSync(long nativeProfileSyncServiceAndroid); |
511 private native void nativeDisableSync(long nativeProfileSyncServiceAndroid); | 523 private native void nativeDisableSync(long nativeProfileSyncServiceAndroid); |
512 private native void nativeSignInSync(long nativeProfileSyncServiceAndroid); | 524 private native void nativeSignInSync(long nativeProfileSyncServiceAndroid); |
513 private native void nativeSignOutSync(long nativeProfileSyncServiceAndroid); | 525 private native void nativeSignOutSync(long nativeProfileSyncServiceAndroid); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 long nativeProfileSyncServiceAndroid, boolean syncEverything, long m
odelTypeSelection); | 557 long nativeProfileSyncServiceAndroid, boolean syncEverything, long m
odelTypeSelection); |
546 private native void nativeSetSetupInProgress( | 558 private native void nativeSetSetupInProgress( |
547 long nativeProfileSyncServiceAndroid, boolean inProgress); | 559 long nativeProfileSyncServiceAndroid, boolean inProgress); |
548 private native void nativeSetSyncSetupCompleted(long nativeProfileSyncServic
eAndroid); | 560 private native void nativeSetSyncSetupCompleted(long nativeProfileSyncServic
eAndroid); |
549 private native boolean nativeHasSyncSetupCompleted(long nativeProfileSyncSer
viceAndroid); | 561 private native boolean nativeHasSyncSetupCompleted(long nativeProfileSyncSer
viceAndroid); |
550 private native boolean nativeIsStartSuppressed(long nativeProfileSyncService
Android); | 562 private native boolean nativeIsStartSuppressed(long nativeProfileSyncService
Android); |
551 private native boolean nativeHasKeepEverythingSynced(long nativeProfileSyncS
erviceAndroid); | 563 private native boolean nativeHasKeepEverythingSynced(long nativeProfileSyncS
erviceAndroid); |
552 private native boolean nativeHasUnrecoverableError(long nativeProfileSyncSer
viceAndroid); | 564 private native boolean nativeHasUnrecoverableError(long nativeProfileSyncSer
viceAndroid); |
553 private native String nativeGetAboutInfoForTest(long nativeProfileSyncServic
eAndroid); | 565 private native String nativeGetAboutInfoForTest(long nativeProfileSyncServic
eAndroid); |
554 private native long nativeGetLastSyncedTimeForTest(long nativeProfileSyncSer
viceAndroid); | 566 private native long nativeGetLastSyncedTimeForTest(long nativeProfileSyncSer
viceAndroid); |
| 567 private native void nativeOverrideNetworkResourcesForTest( |
| 568 long nativeProfileSyncServiceAndroid, long networkResources); |
555 } | 569 } |
OLD | NEW |