Pass JavaRef to Java methods in device/bluetooth.

Update code in device/bluetooth to use JavaRef when calling Java methods
via JNI, instead of passing bare jobject. Various function parameter
types are converted from jobject to JavaRef to enable calls to obj()
higher up the call chain to be removed.

BUG=506850

Review-Url: https://codereview.chromium.org/2313413002
Cr-Commit-Position: refs/heads/master@{#417283}
diff --git a/device/bluetooth/bluetooth_device_android.h b/device/bluetooth/bluetooth_device_android.h
index 8e68e5a..23b7fd0 100644
--- a/device/bluetooth/bluetooth_device_android.h
+++ b/device/bluetooth/bluetooth_device_android.h
@@ -10,6 +10,7 @@
 #include <memory>
 
 #include "base/android/jni_android.h"
+#include "base/android/scoped_java_ref.h"
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "device/bluetooth/bluetooth_adapter_android.h"
@@ -34,7 +35,8 @@
   // this correctly. http://crbug.com/506416
   static BluetoothDeviceAndroid* Create(
       BluetoothAdapterAndroid* adapter,
-      jobject bluetooth_device_wrapper);  // Java Type: bluetoothDeviceWrapper
+      const base::android::JavaRef<jobject>&
+          bluetooth_device_wrapper);  // Java Type: bluetoothDeviceWrapper
 
   ~BluetoothDeviceAndroid() override;