| Index: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
|
| diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
|
| index 52f1991b480d5490aaf2d526f09ded3bd6849f44..dc6e4610f75128036822dc1e9d7deb2e586cd657 100644
|
| --- a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
|
| +++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
|
| @@ -6,9 +6,9 @@ package org.chromium.device.bluetooth;
|
|
|
| import android.annotation.TargetApi;
|
| import android.bluetooth.BluetoothDevice;
|
| -import android.content.Context;
|
| import android.os.Build;
|
|
|
| +import org.chromium.base.ContextUtils;
|
| import org.chromium.base.Log;
|
| import org.chromium.base.annotations.CalledByNative;
|
| import org.chromium.base.annotations.JNINamespace;
|
| @@ -100,17 +100,17 @@ final class ChromeBluetoothDevice {
|
|
|
| // Implements BluetoothDeviceAndroid::CreateGattConnectionImpl.
|
| @CalledByNative
|
| - private void createGattConnectionImpl(Context context) {
|
| + private void createGattConnectionImpl() {
|
| Log.i(TAG, "connectGatt");
|
|
|
| if (mBluetoothGatt != null) mBluetoothGatt.close();
|
|
|
| // autoConnect set to false as under experimentation using autoConnect failed to complete
|
| // connections.
|
| - mBluetoothGatt =
|
| - mDevice.connectGatt(context, false /* autoConnect */, mBluetoothGattCallbackImpl,
|
| - // Prefer LE for dual-mode devices due to lower energy consumption.
|
| - BluetoothDevice.TRANSPORT_LE);
|
| + mBluetoothGatt = mDevice.connectGatt(ContextUtils.getApplicationContext(),
|
| + false /* autoConnect */, mBluetoothGattCallbackImpl,
|
| + // Prefer LE for dual-mode devices due to lower energy consumption.
|
| + BluetoothDevice.TRANSPORT_LE);
|
| }
|
|
|
| // Implements BluetoothDeviceAndroid::DisconnectGatt.
|
|
|