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

Unified Diff: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java

Issue 2847523002: Android: Remove GetApplicationContext part 4 (Closed)
Patch Set: Rebase and fix build 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 side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698