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

Unified Diff: device/bluetooth/bluetooth_adapter_android.h

Issue 1215303006: bluetooth: android: Initial BluetoothDeviceAndroid implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-discovery-
Patch Set: Merge TOT Created 5 years, 5 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 52e257d8c1f40d80f71db4ed868361e1112720b1..34f9d938641fd57c9c27709865d82e05f4d5e4f1 100644
--- a/device/bluetooth/bluetooth_adapter_android.h
+++ b/device/bluetooth/bluetooth_adapter_android.h
@@ -27,7 +27,9 @@ namespace device {
// technical reason they can not be supported should a need arrise.
//
// BluetoothAdapterAndroid is reference counted, and owns the lifetime of the
-// Java class BluetoothAdapter via j_adapter_.
+// Java class BluetoothAdapter via j_adapter_. The adapter also owns a tree of
+// additional C++ objects (Devices, Services, Characteristics, Descriptors),
+// with each C++ object owning its associated Java class.
class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterAndroid final
: public BluetoothAdapter {
public:
@@ -37,9 +39,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterAndroid final
// will return false for |IsPresent()| and not be functional.
//
// The BluetoothAdapterAndroid instance will indirectly hold a Java reference
- // to |java_bluetooth_adapter_wrapper|.
+ // to |bluetooth_adapter_wrapper|.
static base::WeakPtr<BluetoothAdapterAndroid> Create(
- jobject java_bluetooth_adapter_wrapper);
+ jobject bluetooth_adapter_wrapper); // Java Type: bluetoothAdapterWrapper
// Register C++ methods exposed to Java using JNI.
static bool RegisterJNI(JNIEnv* env);
@@ -81,7 +83,16 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterAndroid final
const CreateAdvertisementErrorCallback& error_callback) override;
// Handles a scan error event by invalidating all discovery sessions.
- void OnScanFailed(JNIEnv* env, jobject obj);
+ void OnScanFailed(JNIEnv* env, jobject caller);
+
+ // Creates or updates device with advertised UUID information when a device is
+ // discovered during a scan.
+ void CreateOrUpdateDeviceOnScan(
+ JNIEnv* env,
+ jobject caller,
+ const jstring& address,
+ jobject bluetooth_device_wrapper, // Java Type: bluetoothDeviceWrapper
+ jobject advertised_uuids); // Java Type: List<ParcelUuid>
protected:
BluetoothAdapterAndroid();
« 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