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

Side by Side Diff: device/bluetooth/test/bluetooth_test_android.cc

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 unified diff | Download patch
« no previous file with comments | « device/bluetooth/test/bluetooth_test_android.h ('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 #include "device/bluetooth/test/bluetooth_test_android.h" 5 #include "device/bluetooth/test/bluetooth_test_android.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "device/bluetooth/android/wrappers.h" 8 #include "device/bluetooth/android/wrappers.h"
9 #include "device/bluetooth/bluetooth_adapter_android.h" 9 #include "device/bluetooth/bluetooth_adapter_android.h"
10 #include "jni/Fakes_jni.h" 10 #include "jni/Fakes_jni.h"
(...skipping 18 matching lines...) Expand all
29 adapter_ = 29 adapter_ =
30 BluetoothAdapterAndroid::Create( 30 BluetoothAdapterAndroid::Create(
31 BluetoothAdapterWrapper_CreateWithDefaultAdapter().obj()).get(); 31 BluetoothAdapterWrapper_CreateWithDefaultAdapter().obj()).get();
32 } 32 }
33 33
34 void BluetoothTestAndroid::InitWithoutDefaultAdapter() { 34 void BluetoothTestAndroid::InitWithoutDefaultAdapter() {
35 adapter_ = BluetoothAdapterAndroid::Create(NULL).get(); 35 adapter_ = BluetoothAdapterAndroid::Create(NULL).get();
36 } 36 }
37 37
38 void BluetoothTestAndroid::InitWithFakeAdapter() { 38 void BluetoothTestAndroid::InitWithFakeAdapter() {
39 j_fake_bluetooth_adapter_.Reset(
40 Java_FakeBluetoothAdapter_create(AttachCurrentThread()));
41
39 adapter_ = 42 adapter_ =
40 BluetoothAdapterAndroid::Create( 43 BluetoothAdapterAndroid::Create(j_fake_bluetooth_adapter_.obj()).get();
41 Java_FakeBluetoothAdapter_create(AttachCurrentThread()).obj()).get(); 44 }
45
46 void BluetoothTestAndroid::DiscoverLowEnergyDevice(int device_ordinal) {
47 Java_FakeBluetoothAdapter_discoverLowEnergyDevice(
48 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj(), device_ordinal);
42 } 49 }
43 50
44 } // namespace device 51 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698