Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/invalidation/ChromeBrowserSyncAdapterService.java

Issue 2830843004: Update to newer Android Lint and suppress new Lint errors (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.invalidation; 5 package org.chromium.chrome.browser.invalidation;
6 6
7 import android.annotation.SuppressLint;
7 import android.app.Service; 8 import android.app.Service;
8 import android.content.Context; 9 import android.content.Context;
9 import android.content.Intent; 10 import android.content.Intent;
10 import android.os.IBinder; 11 import android.os.IBinder;
11 12
12 import org.chromium.chrome.browser.init.ProcessInitializationHandler; 13 import org.chromium.chrome.browser.init.ProcessInitializationHandler;
13 14
14 /** 15 /**
15 * A Service that provides access to {@link ChromeBrowserSyncAdapter}. 16 * A Service that provides access to {@link ChromeBrowserSyncAdapter}.
16 */ 17 */
17 public class ChromeBrowserSyncAdapterService extends Service { 18 public class ChromeBrowserSyncAdapterService extends Service {
19
20 // TODO(crbug.com/635567): Fix this properly.
21 @SuppressLint("StaticFieldLeak")
18 private static ChromeBrowserSyncAdapter sSyncAdapter; 22 private static ChromeBrowserSyncAdapter sSyncAdapter;
19 private static final Object LOCK = new Object(); 23 private static final Object LOCK = new Object();
20 24
21 /** 25 /**
22 * Get the sync adapter reference, creating an instance if necessary. 26 * Get the sync adapter reference, creating an instance if necessary.
23 */ 27 */
24 private ChromeBrowserSyncAdapter getOrCreateSyncAdapter(Context applicationC ontext) { 28 private ChromeBrowserSyncAdapter getOrCreateSyncAdapter(Context applicationC ontext) {
25 synchronized (LOCK) { 29 synchronized (LOCK) {
26 if (sSyncAdapter == null) { 30 if (sSyncAdapter == null) {
27 ProcessInitializationHandler.getInstance().initializePreNative() ; 31 ProcessInitializationHandler.getInstance().initializePreNative() ;
28 sSyncAdapter = new ChromeBrowserSyncAdapter(applicationContext, getApplication()); 32 sSyncAdapter = new ChromeBrowserSyncAdapter(applicationContext, getApplication());
29 } 33 }
30 } 34 }
31 return sSyncAdapter; 35 return sSyncAdapter;
32 } 36 }
33 37
34 @Override 38 @Override
35 public IBinder onBind(Intent intent) { 39 public IBinder onBind(Intent intent) {
36 return getOrCreateSyncAdapter(getApplicationContext()).getSyncAdapterBin der(); 40 return getOrCreateSyncAdapter(getApplicationContext()).getSyncAdapterBin der();
37 } 41 }
38 } 42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698