| Index: device/bluetooth/bluetooth_adapter_android.cc
|
| diff --git a/device/bluetooth/bluetooth_adapter_android.cc b/device/bluetooth/bluetooth_adapter_android.cc
|
| index 007136d8c8d61734113e5e2bf0e561d49e113012..d1545b3d3209c2c7a19ec43bd1e3bf48c16f52e7 100644
|
| --- a/device/bluetooth/bluetooth_adapter_android.cc
|
| +++ b/device/bluetooth/bluetooth_adapter_android.cc
|
| @@ -46,8 +46,8 @@ bool BluetoothAdapterAndroid::RegisterJNI(JNIEnv* env) {
|
| return RegisterNativesImpl(env); // Generated in BluetoothAdapter_jni.h
|
| }
|
|
|
| -bool BluetoothAdapterAndroid::HasBluetoothPermission() const {
|
| - return Java_BluetoothAdapter_hasBluetoothPermission(
|
| +bool BluetoothAdapterAndroid::HasBluetoothCapability() const {
|
| + return Java_BluetoothAdapter_hasBluetoothCapability(
|
| AttachCurrentThread(), j_bluetooth_adapter_.obj());
|
| }
|
|
|
| @@ -146,20 +146,32 @@ void BluetoothAdapterAndroid::AddDiscoverySession(
|
| BluetoothDiscoveryFilter* discovery_filter,
|
| const base::Closure& callback,
|
| const ErrorCallback& error_callback) {
|
| - error_callback.Run();
|
| + // TODO(scheib): Support filters crbug.com/490401
|
| + if (Java_BluetoothAdapter_addDiscoverySession(AttachCurrentThread(),
|
| + j_bluetooth_adapter_.obj())) {
|
| + callback.Run();
|
| + } else {
|
| + error_callback.Run();
|
| + }
|
| }
|
|
|
| void BluetoothAdapterAndroid::RemoveDiscoverySession(
|
| BluetoothDiscoveryFilter* discovery_filter,
|
| const base::Closure& callback,
|
| const ErrorCallback& error_callback) {
|
| - error_callback.Run();
|
| + if (Java_BluetoothAdapter_removeDiscoverySession(
|
| + AttachCurrentThread(), j_bluetooth_adapter_.obj())) {
|
| + callback.Run();
|
| + } else {
|
| + error_callback.Run();
|
| + }
|
| }
|
|
|
| void BluetoothAdapterAndroid::SetDiscoveryFilter(
|
| scoped_ptr<BluetoothDiscoveryFilter> discovery_filter,
|
| const base::Closure& callback,
|
| const ErrorCallback& error_callback) {
|
| + NOTIMPLEMENTED();
|
| error_callback.Run();
|
| }
|
|
|
|
|