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

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

Issue 1618273002: Call BluetoothGatt#close() after disconnecting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call parent class' TearDown Created 4 years, 10 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
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.BluetoothDevice; 9 import android.bluetooth.BluetoothDevice;
10 import android.bluetooth.le.ScanFilter; 10 import android.bluetooth.le.ScanFilter;
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 mDevice = device; 318 mDevice = device;
319 mServices = new ArrayList<Wrappers.BluetoothGattServiceWrapper>(); 319 mServices = new ArrayList<Wrappers.BluetoothGattServiceWrapper>();
320 } 320 }
321 321
322 @Override 322 @Override
323 public void disconnect() { 323 public void disconnect() {
324 nativeOnFakeBluetoothGattDisconnect(mDevice.mAdapter.mNativeBluetoot hTestAndroid); 324 nativeOnFakeBluetoothGattDisconnect(mDevice.mAdapter.mNativeBluetoot hTestAndroid);
325 } 325 }
326 326
327 @Override 327 @Override
328 public void close() {
329 nativeOnFakeBluetoothGattClose(mDevice.mAdapter.mNativeBluetoothTest Android);
330 }
331
332 @Override
328 public void discoverServices() { 333 public void discoverServices() {
329 nativeOnFakeBluetoothGattDiscoverServices(mDevice.mAdapter.mNativeBl uetoothTestAndroid); 334 nativeOnFakeBluetoothGattDiscoverServices(mDevice.mAdapter.mNativeBl uetoothTestAndroid);
330 } 335 }
331 336
332 @Override 337 @Override
333 public List<Wrappers.BluetoothGattServiceWrapper> getServices() { 338 public List<Wrappers.BluetoothGattServiceWrapper> getServices() {
334 return mServices; 339 return mServices;
335 } 340 }
336 341
337 @Override 342 @Override
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 // ------------------------------------------------------------------------- -------------------- 672 // ------------------------------------------------------------------------- --------------------
668 // BluetoothTestAndroid C++ methods declared for access from java: 673 // BluetoothTestAndroid C++ methods declared for access from java:
669 674
670 // Binds to BluetoothTestAndroid::OnFakeBluetoothDeviceConnectGattCalled. 675 // Binds to BluetoothTestAndroid::OnFakeBluetoothDeviceConnectGattCalled.
671 private static native void nativeOnFakeBluetoothDeviceConnectGattCalled( 676 private static native void nativeOnFakeBluetoothDeviceConnectGattCalled(
672 long nativeBluetoothTestAndroid); 677 long nativeBluetoothTestAndroid);
673 678
674 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattDisconnect. 679 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattDisconnect.
675 private static native void nativeOnFakeBluetoothGattDisconnect(long nativeBl uetoothTestAndroid); 680 private static native void nativeOnFakeBluetoothGattDisconnect(long nativeBl uetoothTestAndroid);
676 681
682 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattClose.
683 private static native void nativeOnFakeBluetoothGattClose(long nativeBluetoo thTestAndroid);
684
677 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattDiscoverServices. 685 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattDiscoverServices.
678 private static native void nativeOnFakeBluetoothGattDiscoverServices( 686 private static native void nativeOnFakeBluetoothGattDiscoverServices(
679 long nativeBluetoothTestAndroid); 687 long nativeBluetoothTestAndroid);
680 688
681 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattSetCharacteristicNotifi cation. 689 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattSetCharacteristicNotifi cation.
682 private static native void nativeOnFakeBluetoothGattSetCharacteristicNotific ation( 690 private static native void nativeOnFakeBluetoothGattSetCharacteristicNotific ation(
683 long nativeBluetoothTestAndroid); 691 long nativeBluetoothTestAndroid);
684 692
685 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattReadCharacteristic. 693 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattReadCharacteristic.
686 private static native void nativeOnFakeBluetoothGattReadCharacteristic( 694 private static native void nativeOnFakeBluetoothGattReadCharacteristic(
687 long nativeBluetoothTestAndroid); 695 long nativeBluetoothTestAndroid);
688 696
689 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattWriteCharacteristic. 697 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattWriteCharacteristic.
690 private static native void nativeOnFakeBluetoothGattWriteCharacteristic( 698 private static native void nativeOnFakeBluetoothGattWriteCharacteristic(
691 long nativeBluetoothTestAndroid, byte[] value); 699 long nativeBluetoothTestAndroid, byte[] value);
692 700
693 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattWriteDescriptor. 701 // Binds to BluetoothTestAndroid::OnFakeBluetoothGattWriteDescriptor.
694 private static native void nativeOnFakeBluetoothGattWriteDescriptor( 702 private static native void nativeOnFakeBluetoothGattWriteDescriptor(
695 long nativeBluetoothTestAndroid, byte[] value); 703 long nativeBluetoothTestAndroid, byte[] value);
696 } 704 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698