Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bb29dda65c3959ca27c7439feeed64c00fe6405a |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chrome.browser.physicalweb; |
| + |
| +import android.app.Application; |
| + |
| +import org.chromium.base.Log; |
| +import org.chromium.chrome.browser.ChromeApplication; |
| + |
| +import java.util.concurrent.atomic.AtomicReference; |
| + |
|
aurimas (slooooooooow)
2015/09/10 17:09:04
Remove the extra line
cco3
2015/09/11 17:10:46
Done.
|
| + |
| +/** |
| + * This class provides the basic interface to the Physical Web feature. |
| + */ |
| +public class PhysicalWebBleClient { |
| + private static AtomicReference<PhysicalWebBleClient> sInstance = |
| + new AtomicReference<PhysicalWebBleClient>(); |
| + private static final String TAG = "cr.PhysicalWeb"; |
| + |
| + public static PhysicalWebBleClient getInstance(Application application) { |
| + if (sInstance.get() == null) { |
| + ChromeApplication chromeApplication = (ChromeApplication) application; |
| + sInstance.compareAndSet(null, chromeApplication.createPhysicalWebBleClient()); |
| + } |
| + return sInstance.get(); |
| + } |
| + |
| + void subscribe() { |
| + Log.d(TAG, "subscribing in empty client"); |
| + } |
| +} |