OLD | NEW |
---|---|
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 #include "device/bluetooth/bluetooth_adapter_android.h" | 5 #include "device/bluetooth/bluetooth_adapter_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 AttachCurrentThread(), j_bluetooth_adapter_.obj())); | 61 AttachCurrentThread(), j_bluetooth_adapter_.obj())); |
62 } | 62 } |
63 | 63 |
64 void BluetoothAdapterAndroid::SetName(const std::string& name, | 64 void BluetoothAdapterAndroid::SetName(const std::string& name, |
65 const base::Closure& callback, | 65 const base::Closure& callback, |
66 const ErrorCallback& error_callback) { | 66 const ErrorCallback& error_callback) { |
67 NOTIMPLEMENTED(); | 67 NOTIMPLEMENTED(); |
68 } | 68 } |
69 | 69 |
70 bool BluetoothAdapterAndroid::IsInitialized() const { | 70 bool BluetoothAdapterAndroid::IsInitialized() const { |
71 NOTIMPLEMENTED(); | 71 return true; |
72 return false; | |
73 } | 72 } |
74 | 73 |
75 bool BluetoothAdapterAndroid::IsPresent() const { | 74 bool BluetoothAdapterAndroid::IsPresent() const { |
76 return Java_BluetoothAdapter_isPresent(AttachCurrentThread(), | 75 return Java_BluetoothAdapter_isPresent(AttachCurrentThread(), |
77 j_bluetooth_adapter_.obj()); | 76 j_bluetooth_adapter_.obj()); |
78 } | 77 } |
79 | 78 |
80 bool BluetoothAdapterAndroid::IsPowered() const { | 79 bool BluetoothAdapterAndroid::IsPowered() const { |
81 return Java_BluetoothAdapter_isPowered(AttachCurrentThread(), | 80 return Java_BluetoothAdapter_isPowered(AttachCurrentThread(), |
82 j_bluetooth_adapter_.obj()); | 81 j_bluetooth_adapter_.obj()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 | 138 |
140 BluetoothAdapterAndroid::BluetoothAdapterAndroid() : weak_ptr_factory_(this) { | 139 BluetoothAdapterAndroid::BluetoothAdapterAndroid() : weak_ptr_factory_(this) { |
141 } | 140 } |
142 | 141 |
143 BluetoothAdapterAndroid::~BluetoothAdapterAndroid() { | 142 BluetoothAdapterAndroid::~BluetoothAdapterAndroid() { |
144 } | 143 } |
145 | 144 |
146 void BluetoothAdapterAndroid::AddDiscoverySession( | 145 void BluetoothAdapterAndroid::AddDiscoverySession( |
147 BluetoothDiscoveryFilter* discovery_filter, | 146 BluetoothDiscoveryFilter* discovery_filter, |
148 const base::Closure& callback, | 147 const base::Closure& callback, |
149 const ErrorCallback& error_callback) { | 148 const ErrorCallback& error_callback) { |
armansito
2015/05/12 22:39:33
Would it make sense to add NOTIMPLEMENTED() to the
scheib
2015/05/13 22:54:03
No, as they are actually called (and the error han
| |
149 error_callback.Run(); | |
150 } | 150 } |
151 | 151 |
152 void BluetoothAdapterAndroid::RemoveDiscoverySession( | 152 void BluetoothAdapterAndroid::RemoveDiscoverySession( |
153 BluetoothDiscoveryFilter* discovery_filter, | 153 BluetoothDiscoveryFilter* discovery_filter, |
154 const base::Closure& callback, | 154 const base::Closure& callback, |
155 const ErrorCallback& error_callback) { | 155 const ErrorCallback& error_callback) { |
156 error_callback.Run(); | |
156 } | 157 } |
157 | 158 |
158 void BluetoothAdapterAndroid::SetDiscoveryFilter( | 159 void BluetoothAdapterAndroid::SetDiscoveryFilter( |
159 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, | 160 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, |
160 const base::Closure& callback, | 161 const base::Closure& callback, |
161 const ErrorCallback& error_callback) { | 162 const ErrorCallback& error_callback) { |
163 error_callback.Run(); | |
162 } | 164 } |
163 | 165 |
164 void BluetoothAdapterAndroid::RemovePairingDelegateInternal( | 166 void BluetoothAdapterAndroid::RemovePairingDelegateInternal( |
165 device::BluetoothDevice::PairingDelegate* pairing_delegate) { | 167 device::BluetoothDevice::PairingDelegate* pairing_delegate) { |
166 } | 168 } |
167 | 169 |
168 } // namespace device | 170 } // namespace device |
OLD | NEW |