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

Side by Side Diff: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java

Issue 1745463002: bluetooth: android: register for adapter on/off events followup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge tip of tree with perja's commit. Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/android/bluetooth_chooser_android.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.device.bluetooth; 5 package org.chromium.device.bluetooth;
6 6
7 import android.Manifest; 7 import android.Manifest;
8 import android.annotation.TargetApi; 8 import android.annotation.TargetApi;
9 import android.bluetooth.BluetoothAdapter; 9 import android.bluetooth.BluetoothAdapter;
10 import android.bluetooth.le.ScanSettings; 10 import android.bluetooth.le.ScanSettings;
(...skipping 16 matching lines...) Expand all
27 * device::BluetoothAdapter. 27 * device::BluetoothAdapter.
28 * 28 *
29 * Lifetime is controlled by device::BluetoothAdapterAndroid. 29 * Lifetime is controlled by device::BluetoothAdapterAndroid.
30 */ 30 */
31 @JNINamespace("device") 31 @JNINamespace("device")
32 @TargetApi(Build.VERSION_CODES.LOLLIPOP) 32 @TargetApi(Build.VERSION_CODES.LOLLIPOP)
33 final class ChromeBluetoothAdapter extends BroadcastReceiver { 33 final class ChromeBluetoothAdapter extends BroadcastReceiver {
34 private static final String TAG = "Bluetooth"; 34 private static final String TAG = "Bluetooth";
35 35
36 private long mNativeBluetoothAdapterAndroid; 36 private long mNativeBluetoothAdapterAndroid;
37 private Wrappers.BluetoothAdapterWrapper mAdapter; 37 // mAdapter is final to ensure registerReceiver is followed by unregisterRec eiver.
38 private final Wrappers.BluetoothAdapterWrapper mAdapter;
38 private int mNumDiscoverySessions; 39 private int mNumDiscoverySessions;
39 private ScanCallback mScanCallback; 40 private ScanCallback mScanCallback;
40 41
41 // ------------------------------------------------------------------------- -------------------- 42 // ------------------------------------------------------------------------- --------------------
42 // Construction and handler for C++ object destruction. 43 // Construction and handler for C++ object destruction.
43 44
44 /** 45 /**
45 * Constructs a ChromeBluetoothAdapter. 46 * Constructs a ChromeBluetoothAdapter.
46 * @param nativeBluetoothAdapterAndroid Is the associated C++ 47 * @param nativeBluetoothAdapterAndroid Is the associated C++
47 * BluetoothAdapterAndroid pointer valu e. 48 * BluetoothAdapterAndroid pointer valu e.
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 // 'Object' type must be used for |bluetoothDeviceWrapper| because inner cla ss 344 // 'Object' type must be used for |bluetoothDeviceWrapper| because inner cla ss
344 // Wrappers.BluetoothDeviceWrapper reference is not handled by jni_generator .py JavaToJni. 345 // Wrappers.BluetoothDeviceWrapper reference is not handled by jni_generator .py JavaToJni.
345 // http://crbug.com/505554 346 // http://crbug.com/505554
346 private native void nativeCreateOrUpdateDeviceOnScan(long nativeBluetoothAda pterAndroid, 347 private native void nativeCreateOrUpdateDeviceOnScan(long nativeBluetoothAda pterAndroid,
347 String address, Object bluetoothDeviceWrapper, List<ParcelUuid> adve rtisedUuids); 348 String address, Object bluetoothDeviceWrapper, List<ParcelUuid> adve rtisedUuids);
348 349
349 // Binds to BluetoothAdapterAndroid::nativeOnAdapterStateChanged 350 // Binds to BluetoothAdapterAndroid::nativeOnAdapterStateChanged
350 private native void nativeOnAdapterStateChanged( 351 private native void nativeOnAdapterStateChanged(
351 long nativeBluetoothAdapterAndroid, boolean powered); 352 long nativeBluetoothAdapterAndroid, boolean powered);
352 } 353 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/bluetooth_chooser_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698