Chromium Code Reviews| Index: device/bluetooth/android/java/src/org/chromium/device/bluetooth/Wrappers.java |
| diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/Wrappers.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/Wrappers.java |
| index 155897c18fd0ca600f4eb221b1bba9829f9fb35e..4c01be2bc3b26eaa52c99efb7463126aaae15c64 100644 |
| --- a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/Wrappers.java |
| +++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/Wrappers.java |
| @@ -18,10 +18,7 @@ import android.bluetooth.le.ScanCallback; |
| import android.bluetooth.le.ScanFilter; |
| import android.bluetooth.le.ScanResult; |
| import android.bluetooth.le.ScanSettings; |
| -import android.content.BroadcastReceiver; |
| import android.content.Context; |
| -import android.content.Intent; |
| -import android.content.IntentFilter; |
| import android.content.pm.PackageManager; |
| import android.os.Build; |
| import android.os.ParcelUuid; |
| @@ -29,7 +26,6 @@ import android.os.ParcelUuid; |
| import org.chromium.base.Log; |
| import org.chromium.base.annotations.CalledByNative; |
| import org.chromium.base.annotations.JNINamespace; |
| -import org.chromium.components.location.LocationUtils; |
| import java.util.ArrayList; |
| import java.util.HashMap; |
| @@ -56,7 +52,7 @@ class Wrappers { |
| */ |
| static class BluetoothAdapterWrapper { |
| private final BluetoothAdapter mAdapter; |
| - protected final ContextWrapper mContext; |
| + protected final Context mContext; |
| protected BluetoothLeScannerWrapper mScannerWrapper; |
| /** |
| @@ -99,11 +95,11 @@ class Wrappers { |
| Log.i(TAG, "BluetoothAdapterWrapper.create failed: Default adapter not found."); |
| return null; |
| } else { |
| - return new BluetoothAdapterWrapper(adapter, new ContextWrapper(context)); |
| + return new BluetoothAdapterWrapper(adapter, context); |
| } |
| } |
| - public BluetoothAdapterWrapper(BluetoothAdapter adapter, ContextWrapper context) { |
| + public BluetoothAdapterWrapper(BluetoothAdapter adapter, Context context) { |
| mAdapter = adapter; |
| mContext = context; |
| } |
| @@ -131,7 +127,7 @@ class Wrappers { |
| return mScannerWrapper; |
| } |
| - public ContextWrapper getContext() { |
| + public Context getContext() { |
| return mContext; |
| } |
| @@ -153,29 +149,6 @@ class Wrappers { |
| } |
| /** |
|
scheib
2016/06/30 20:52:34
This is just spiffy, thanks for noticing.
|
| - * Wraps android.content.Context. |
| - */ |
| - static class ContextWrapper { |
| - private final Context mContext; |
| - |
| - public ContextWrapper(Context context) { |
| - mContext = context; |
| - } |
| - |
| - public boolean hasAndroidLocationPermission() { |
| - return LocationUtils.getInstance().hasAndroidLocationPermission(mContext); |
| - } |
| - |
| - public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) { |
| - return mContext.registerReceiver(receiver, filter); |
| - } |
| - |
| - public void unregisterReceiver(BroadcastReceiver receiver) { |
| - mContext.unregisterReceiver(receiver); |
| - } |
| - } |
| - |
| - /** |
| * Wraps android.bluetooth.BluetoothLeScanner. |
| */ |
| static class BluetoothLeScannerWrapper { |