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

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

Issue 1842223003: Remove outdated devices from Android device chooser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't purge devices continuously. Added more tests. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java
diff --git a/device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java b/device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java
index 35d2dbcaf67247147ba9b0ac1642c6962269b0c7..23c1f60d981457edc7889058112e233b37de3ac4 100644
--- a/device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java
+++ b/device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java
@@ -287,6 +287,7 @@ class Fakes {
private String mAddress;
private String mName;
final FakeBluetoothGatt mGatt;
+ private int mBondState;
private Wrappers.BluetoothGattCallbackWrapper mGattCallback;
public FakeBluetoothDevice(FakeBluetoothAdapter adapter, String address, String name) {
@@ -295,6 +296,13 @@ class Fakes {
mAddress = address;
mName = name;
mGatt = new FakeBluetoothGatt(this);
+ mBondState = BluetoothDevice.BOND_NONE;
+ }
+
+ @CalledByNative("FakeBluetoothDevice")
+ public static void setBonded(ChromeBluetoothDevice chromeDevice) {
+ FakeBluetoothDevice fakeDevice = (FakeBluetoothDevice) chromeDevice.mDevice;
+ fakeDevice.mBondState = BluetoothDevice.BOND_BONDED;
}
// Create a call to onConnectionStateChange on the |chrome_device| using parameters
@@ -358,7 +366,7 @@ class Fakes {
@Override
public int getBondState() {
- return BluetoothDevice.BOND_NONE;
+ return mBondState;
}
@Override

Powered by Google App Engine
This is Rietveld 408576698