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 538f618d6aa7efeadd0f9e9cea26a499a4920c99..46f9c664a5a37ff8792a7882d4c1f1c23d2f3780 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 |
@@ -9,7 +9,11 @@ import android.annotation.TargetApi; |
import android.bluetooth.BluetoothDevice; |
import android.bluetooth.le.ScanFilter; |
import android.bluetooth.le.ScanSettings; |
+import android.content.BroadcastReceiver; |
import android.content.Context; |
+import android.content.Intent; |
+import android.content.IntentFilter; |
+ |
import android.os.Build; |
import android.os.ParcelUuid; |
@@ -133,12 +137,14 @@ class Fakes { |
@Override |
public boolean disable() { |
mPowered = false; |
+ nativeOnFakeAdapterStateChanged(mNativeBluetoothTestAndroid, false); |
return true; |
} |
@Override |
public boolean enable() { |
mPowered = true; |
+ nativeOnFakeAdapterStateChanged(mNativeBluetoothTestAndroid, true); |
return true; |
} |
@@ -191,6 +197,14 @@ class Fakes { |
public boolean checkPermission(String permission) { |
return mPermissions.contains(permission); |
} |
+ |
+ @Override |
+ public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) { |
+ return null; |
+ } |
+ |
+ @Override |
+ public void unregisterReceiver(BroadcastReceiver receiver) {} |
} |
/** |
@@ -715,6 +729,10 @@ class Fakes { |
// --------------------------------------------------------------------------------------------- |
// BluetoothTestAndroid C++ methods declared for access from java: |
+ // Binds to BluetoothTestAndroid::OnFakeAdapterStateChanged. |
+ private static native void nativeOnFakeAdapterStateChanged( |
+ long nativeBluetoothTestAndroid, boolean powered); |
+ |
// Binds to BluetoothTestAndroid::OnFakeBluetoothDeviceConnectGattCalled. |
private static native void nativeOnFakeBluetoothDeviceConnectGattCalled( |
long nativeBluetoothTestAndroid); |