Loading android/app/src/com/android/bluetooth/hfpclient/NativeInterface.java +4 −0 Original line number Diff line number Diff line Loading @@ -275,6 +275,10 @@ public class NativeInterface { */ @VisibleForTesting public boolean sendAndroidAt(BluetoothDevice device, String cmd) { if (device == null) { Log.w(TAG, "Don't need to send " + cmd + " because no remote device"); return false; } return sendAndroidAtNative(getByteAddress(device), cmd); } Loading android/app/tests/unit/src/com/android/bluetooth/hfpclient/HfpNativeInterfaceTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.bluetooth.hfpclient; import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading Loading @@ -308,4 +309,10 @@ public class HfpNativeInterfaceTest { assertThat(event.getValue().type).isEqualTo(StackEvent.EVENT_TYPE_UNKNOWN_EVENT); assertThat(event.getValue().valueString).isEqualTo(eventString); } @Test public void testSendAndroidAt() { // If the device is null, should return False assertThat(mNativeInterface.sendAndroidAt(null, anyString())).isEqualTo(false); } } Loading
android/app/src/com/android/bluetooth/hfpclient/NativeInterface.java +4 −0 Original line number Diff line number Diff line Loading @@ -275,6 +275,10 @@ public class NativeInterface { */ @VisibleForTesting public boolean sendAndroidAt(BluetoothDevice device, String cmd) { if (device == null) { Log.w(TAG, "Don't need to send " + cmd + " because no remote device"); return false; } return sendAndroidAtNative(getByteAddress(device), cmd); } Loading
android/app/tests/unit/src/com/android/bluetooth/hfpclient/HfpNativeInterfaceTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.bluetooth.hfpclient; import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading Loading @@ -308,4 +309,10 @@ public class HfpNativeInterfaceTest { assertThat(event.getValue().type).isEqualTo(StackEvent.EVENT_TYPE_UNKNOWN_EVENT); assertThat(event.getValue().valueString).isEqualTo(eventString); } @Test public void testSendAndroidAt() { // If the device is null, should return False assertThat(mNativeInterface.sendAndroidAt(null, anyString())).isEqualTo(false); } }