| 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.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.util.Log; | 9 import android.util.Log; |
| 10 | 10 |
| 11 import org.chromium.base.ActivityState; | 11 import org.chromium.base.ActivityState; |
| 12 import org.chromium.base.ApplicationStatus; | 12 import org.chromium.base.ApplicationStatus; |
| 13 import org.chromium.base.ApplicationStatus.ActivityStateListener; | 13 import org.chromium.base.ApplicationStatus.ActivityStateListener; |
| 14 import org.chromium.base.CalledByNative; | 14 import org.chromium.base.CalledByNative; |
| 15 import org.chromium.base.ThreadUtils; | 15 import org.chromium.base.ThreadUtils; |
| 16 import org.chromium.base.VisibleForTesting; | 16 import org.chromium.base.VisibleForTesting; |
| 17 import org.chromium.base.annotations.SuppressFBWarnings; | |
| 18 import org.chromium.chrome.browser.identity.UniqueIdentificationGenerator; | 17 import org.chromium.chrome.browser.identity.UniqueIdentificationGenerator; |
| 19 import org.chromium.chrome.browser.invalidation.InvalidationServiceFactory; | 18 import org.chromium.chrome.browser.invalidation.InvalidationServiceFactory; |
| 20 import org.chromium.chrome.browser.profiles.Profile; | 19 import org.chromium.chrome.browser.profiles.Profile; |
| 21 import org.chromium.sync.internal_api.pub.PassphraseType; | 20 import org.chromium.sync.internal_api.pub.PassphraseType; |
| 22 import org.chromium.sync.internal_api.pub.base.ModelType; | 21 import org.chromium.sync.internal_api.pub.base.ModelType; |
| 23 | 22 |
| 24 import java.util.HashSet; | 23 import java.util.HashSet; |
| 25 import java.util.Iterator; | 24 import java.util.Iterator; |
| 26 import java.util.List; | 25 import java.util.List; |
| 27 import java.util.Set; | 26 import java.util.Set; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 private final long mNativeProfileSyncServiceAndroid; | 67 private final long mNativeProfileSyncServiceAndroid; |
| 69 | 68 |
| 70 /** | 69 /** |
| 71 * A helper method for retrieving the application-wide SyncSetupManager. | 70 * A helper method for retrieving the application-wide SyncSetupManager. |
| 72 * <p/> | 71 * <p/> |
| 73 * Can only be accessed on the main thread. | 72 * Can only be accessed on the main thread. |
| 74 * | 73 * |
| 75 * @param context the ApplicationContext is retrieved from the context used
as an argument. | 74 * @param context the ApplicationContext is retrieved from the context used
as an argument. |
| 76 * @return a singleton instance of the SyncSetupManager | 75 * @return a singleton instance of the SyncSetupManager |
| 77 */ | 76 */ |
| 78 @SuppressFBWarnings("LI_LAZY_INIT") | |
| 79 public static ProfileSyncService get(Context context) { | 77 public static ProfileSyncService get(Context context) { |
| 80 ThreadUtils.assertOnUiThread(); | 78 ThreadUtils.assertOnUiThread(); |
| 81 if (sSyncSetupManager == null) { | 79 if (sSyncSetupManager == null) { |
| 82 sSyncSetupManager = new ProfileSyncService(context); | 80 sSyncSetupManager = new ProfileSyncService(context); |
| 83 } | 81 } |
| 84 return sSyncSetupManager; | 82 return sSyncSetupManager; |
| 85 } | 83 } |
| 86 | 84 |
| 87 /** | 85 /** |
| 88 * This is called pretty early in our application. Avoid any blocking operat
ions here. | 86 * This is called pretty early in our application. Avoid any blocking operat
ions here. |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 private native void nativeSetSyncSetupCompleted(long nativeProfileSyncServic
eAndroid); | 585 private native void nativeSetSyncSetupCompleted(long nativeProfileSyncServic
eAndroid); |
| 588 private native boolean nativeHasSyncSetupCompleted(long nativeProfileSyncSer
viceAndroid); | 586 private native boolean nativeHasSyncSetupCompleted(long nativeProfileSyncSer
viceAndroid); |
| 589 private native boolean nativeIsStartSuppressed(long nativeProfileSyncService
Android); | 587 private native boolean nativeIsStartSuppressed(long nativeProfileSyncService
Android); |
| 590 private native boolean nativeHasKeepEverythingSynced(long nativeProfileSyncS
erviceAndroid); | 588 private native boolean nativeHasKeepEverythingSynced(long nativeProfileSyncS
erviceAndroid); |
| 591 private native boolean nativeHasUnrecoverableError(long nativeProfileSyncSer
viceAndroid); | 589 private native boolean nativeHasUnrecoverableError(long nativeProfileSyncSer
viceAndroid); |
| 592 private native String nativeGetAboutInfoForTest(long nativeProfileSyncServic
eAndroid); | 590 private native String nativeGetAboutInfoForTest(long nativeProfileSyncServic
eAndroid); |
| 593 private native long nativeGetLastSyncedTimeForTest(long nativeProfileSyncSer
viceAndroid); | 591 private native long nativeGetLastSyncedTimeForTest(long nativeProfileSyncSer
viceAndroid); |
| 594 private native void nativeOverrideNetworkResourcesForTest( | 592 private native void nativeOverrideNetworkResourcesForTest( |
| 595 long nativeProfileSyncServiceAndroid, long networkResources); | 593 long nativeProfileSyncServiceAndroid, long networkResources); |
| 596 } | 594 } |
| OLD | NEW |