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

Unified Diff: device/bluetooth/bluetooth_adapter_android.h

Issue 1119113002: bluetooth: Initial JNI setup for device/bluetooth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Additional comment on RegisterBluetoothJni Created 5 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
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_adapter_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter_android.h
diff --git a/device/bluetooth/bluetooth_adapter_android.h b/device/bluetooth/bluetooth_adapter_android.h
index c2b662cfdca5b7c747aaf55f825dcb9cc7403dd0..cfb9d31733b719f3815ae49a561df2dbbbfb9f41 100644
--- a/device/bluetooth/bluetooth_adapter_android.h
+++ b/device/bluetooth/bluetooth_adapter_android.h
@@ -5,6 +5,7 @@
#ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_
#define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_
+#include "base/android/jni_android.h"
#include "base/memory/weak_ptr.h"
#include "device/bluetooth/bluetooth_adapter.h"
@@ -19,7 +20,14 @@ namespace device {
class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterAndroid final
: public BluetoothAdapter {
public:
- static base::WeakPtr<BluetoothAdapter> CreateAdapter();
+ // Create a BluetoothAdapterAndroid instance.
+ static base::WeakPtr<BluetoothAdapterAndroid> CreateAdapter();
+
+ // Register C++ methods exposed to Java using JNI.
+ static bool RegisterJNI(JNIEnv* env);
+
+ // True if this app has android permissions necessary for Bluetooth.
+ bool HasBluetoothPermission() const;
// BluetoothAdapter:
std::string GetAddress() const override;
@@ -74,6 +82,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterAndroid final
void RemovePairingDelegateInternal(
BluetoothDevice::PairingDelegate* pairing_delegate) override;
+ // Java object org.chromium.device.bluetooth.BluetoothAdapter.
+ base::android::ScopedJavaGlobalRef<jobject> j_bluetooth_adapter_;
+
std::string address_;
std::string name_;
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_adapter_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698