| 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.chrome.browser.services; | 5 package org.chromium.chrome.browser.services; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; |
| 7 import android.content.Context; | 8 import android.content.Context; |
| 8 import android.util.Log; | 9 import android.util.Log; |
| 9 | 10 |
| 10 import org.chromium.base.ApplicationState; | 11 import org.chromium.base.ApplicationState; |
| 11 import org.chromium.base.ApplicationStatus; | 12 import org.chromium.base.ApplicationStatus; |
| 12 import org.chromium.base.ApplicationStatus.ApplicationStateListener; | 13 import org.chromium.base.ApplicationStatus.ApplicationStateListener; |
| 13 import org.chromium.base.ThreadUtils; | 14 import org.chromium.base.ThreadUtils; |
| 14 import org.chromium.base.TraceEvent; | 15 import org.chromium.base.TraceEvent; |
| 15 import org.chromium.base.VisibleForTesting; | 16 import org.chromium.base.VisibleForTesting; |
| 16 import org.chromium.chrome.browser.signin.SigninHelper; | 17 import org.chromium.chrome.browser.signin.SigninHelper; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 30 * The object must be created on the main thread. | 31 * The object must be created on the main thread. |
| 31 * <p/> | 32 * <p/> |
| 32 */ | 33 */ |
| 33 public class GoogleServicesManager implements ApplicationStateListener { | 34 public class GoogleServicesManager implements ApplicationStateListener { |
| 34 | 35 |
| 35 private static final String TAG = "GoogleServicesManager"; | 36 private static final String TAG = "GoogleServicesManager"; |
| 36 | 37 |
| 37 @VisibleForTesting | 38 @VisibleForTesting |
| 38 public static final String SESSION_TAG_PREFIX = "session_sync"; | 39 public static final String SESSION_TAG_PREFIX = "session_sync"; |
| 39 | 40 |
| 41 // TODO(crbug.com/635567): Fix this properly. |
| 42 @SuppressLint("StaticFieldLeak") |
| 40 private static GoogleServicesManager sGoogleServicesManager; | 43 private static GoogleServicesManager sGoogleServicesManager; |
| 41 | 44 |
| 42 @VisibleForTesting | 45 @VisibleForTesting |
| 43 protected final Context mContext; | 46 protected final Context mContext; |
| 44 | 47 |
| 45 private final ChromeSigninController mChromeSigninController; | 48 private final ChromeSigninController mChromeSigninController; |
| 46 | 49 |
| 47 private final SigninHelper mSigninHelper; | 50 private final SigninHelper mSigninHelper; |
| 48 | 51 |
| 49 /** | 52 /** |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 111 } |
| 109 } | 112 } |
| 110 | 113 |
| 111 @Override | 114 @Override |
| 112 public void onApplicationStateChange(int newState) { | 115 public void onApplicationStateChange(int newState) { |
| 113 if (newState == ApplicationState.HAS_RUNNING_ACTIVITIES) { | 116 if (newState == ApplicationState.HAS_RUNNING_ACTIVITIES) { |
| 114 onMainActivityStart(); | 117 onMainActivityStart(); |
| 115 } | 118 } |
| 116 } | 119 } |
| 117 } | 120 } |
| OLD | NEW |