| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.components.sync; | 5 package org.chromium.components.sync; |
| 6 | 6 |
| 7 import android.accounts.Account; | 7 import android.accounts.Account; |
| 8 import android.annotation.SuppressLint; |
| 8 import android.content.ContentResolver; | 9 import android.content.ContentResolver; |
| 9 import android.content.Context; | 10 import android.content.Context; |
| 10 import android.content.SyncStatusObserver; | 11 import android.content.SyncStatusObserver; |
| 11 import android.os.Bundle; | 12 import android.os.Bundle; |
| 12 import android.os.StrictMode; | 13 import android.os.StrictMode; |
| 13 | 14 |
| 14 import org.chromium.base.Callback; | 15 import org.chromium.base.Callback; |
| 15 import org.chromium.base.ObserverList; | 16 import org.chromium.base.ObserverList; |
| 16 import org.chromium.base.VisibleForTesting; | 17 import org.chromium.base.VisibleForTesting; |
| 17 import org.chromium.components.signin.AccountManagerHelper; | 18 import org.chromium.components.signin.AccountManagerHelper; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 33 */ | 34 */ |
| 34 @ThreadSafe | 35 @ThreadSafe |
| 35 public class AndroidSyncSettings { | 36 public class AndroidSyncSettings { |
| 36 public static final String TAG = "AndroidSyncSettings"; | 37 public static final String TAG = "AndroidSyncSettings"; |
| 37 | 38 |
| 38 /** | 39 /** |
| 39 * Lock for ensuring singleton instantiation across threads. | 40 * Lock for ensuring singleton instantiation across threads. |
| 40 */ | 41 */ |
| 41 private static final Object CLASS_LOCK = new Object(); | 42 private static final Object CLASS_LOCK = new Object(); |
| 42 | 43 |
| 44 @SuppressLint("StaticFieldLeak") |
| 43 private static AndroidSyncSettings sInstance; | 45 private static AndroidSyncSettings sInstance; |
| 44 | 46 |
| 45 private final Object mLock = new Object(); | 47 private final Object mLock = new Object(); |
| 46 | 48 |
| 47 private final String mContractAuthority; | 49 private final String mContractAuthority; |
| 48 | 50 |
| 49 private final Context mApplicationContext; | 51 private final Context mApplicationContext; |
| 50 | 52 |
| 51 private final SyncContentResolverDelegate mSyncContentResolverDelegate; | 53 private final SyncContentResolverDelegate mSyncContentResolverDelegate; |
| 52 | 54 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 private void notifyObservers() { | 317 private void notifyObservers() { |
| 316 for (AndroidSyncSettingsObserver observer : mObservers) { | 318 for (AndroidSyncSettingsObserver observer : mObservers) { |
| 317 observer.androidSyncSettingsChanged(); | 319 observer.androidSyncSettingsChanged(); |
| 318 } | 320 } |
| 319 } | 321 } |
| 320 | 322 |
| 321 private String getContractAuthority() { | 323 private String getContractAuthority() { |
| 322 return mApplicationContext.getPackageName(); | 324 return mApplicationContext.getPackageName(); |
| 323 } | 325 } |
| 324 } | 326 } |
| OLD | NEW |