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

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 @SuppressLint("StaticFieldLeak")
18 private static ChromeBrowserSyncAdapter sSyncAdapter; 21 private static ChromeBrowserSyncAdapter sSyncAdapter;
19 private static final Object LOCK = new Object(); 22 private static final Object LOCK = new Object();
20 23
21 /** 24 /**
22 * Get the sync adapter reference, creating an instance if necessary. 25 * Get the sync adapter reference, creating an instance if necessary.
23 */ 26 */
24 private ChromeBrowserSyncAdapter getOrCreateSyncAdapter(Context applicationC ontext) { 27 private ChromeBrowserSyncAdapter getOrCreateSyncAdapter(Context applicationC ontext) {
25 synchronized (LOCK) { 28 synchronized (LOCK) {
26 if (sSyncAdapter == null) { 29 if (sSyncAdapter == null) {
27 ProcessInitializationHandler.getInstance().initializePreNative() ; 30 ProcessInitializationHandler.getInstance().initializePreNative() ;
28 sSyncAdapter = new ChromeBrowserSyncAdapter(applicationContext, getApplication()); 31 sSyncAdapter = new ChromeBrowserSyncAdapter(applicationContext, getApplication());
29 } 32 }
30 } 33 }
31 return sSyncAdapter; 34 return sSyncAdapter;
32 } 35 }
33 36
34 @Override 37 @Override
35 public IBinder onBind(Intent intent) { 38 public IBinder onBind(Intent intent) {
36 return getOrCreateSyncAdapter(getApplicationContext()).getSyncAdapterBin der(); 39 return getOrCreateSyncAdapter(getApplicationContext()).getSyncAdapterBin der();
37 } 40 }
38 } 41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698