Loading android/app/src/com/android/bluetooth/pbapclient/PbapClientBinder.java +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ import java.util.Collections; import java.util.List; /** Handler for incoming service calls destined for PBAP Client */ public class PbapClientBinder extends IBluetoothPbapClient.Stub implements IProfileServiceBinder { class PbapClientBinder extends IBluetoothPbapClient.Stub implements IProfileServiceBinder { private static final String TAG = PbapClientBinder.class.getSimpleName(); private PbapClientService mService; Loading android/app/tests/unit/src/com/android/bluetooth/pbapclient/PbapClientBinderTest.java +8 −8 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyInt; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import android.bluetooth.BluetoothAdapter; Loading Loading @@ -127,7 +127,7 @@ public class PbapClientBinderTest { public void testConnect_afterCleanup_returnsFalse() { mPbapClientBinder.cleanup(); boolean result = mPbapClientBinder.connect(mTestDevice, mAttributionSource); verify(mMockService, times(0)).connect(any(BluetoothDevice.class)); verify(mMockService, never()).connect(any(BluetoothDevice.class)); assertThat(result).isFalse(); } Loading @@ -135,7 +135,7 @@ public class PbapClientBinderTest { public void testDisconnect_afterCleanup_returnsFalse() { mPbapClientBinder.cleanup(); boolean result = mPbapClientBinder.disconnect(mTestDevice, mAttributionSource); verify(mMockService, times(0)).disconnect(any(BluetoothDevice.class)); verify(mMockService, never()).disconnect(any(BluetoothDevice.class)); assertThat(result).isFalse(); } Loading @@ -143,7 +143,7 @@ public class PbapClientBinderTest { public void testGetConnectedDevices_afterCleanup_returnsEmptyList() { mPbapClientBinder.cleanup(); List<BluetoothDevice> devices = mPbapClientBinder.getConnectedDevices(mAttributionSource); verify(mMockService, times(0)).getConnectedDevices(); verify(mMockService, never()).getConnectedDevices(); assertThat(devices).isEmpty(); } Loading @@ -153,7 +153,7 @@ public class PbapClientBinderTest { int[] states = new int[] {BluetoothProfile.STATE_CONNECTED}; List<BluetoothDevice> devices = mPbapClientBinder.getDevicesMatchingConnectionStates(states, mAttributionSource); verify(mMockService, times(0)).getDevicesMatchingConnectionStates(any(int[].class)); verify(mMockService, never()).getDevicesMatchingConnectionStates(any(int[].class)); assertThat(devices).isEmpty(); } Loading @@ -161,7 +161,7 @@ public class PbapClientBinderTest { public void testGetConnectionState_afterCleanup_returnsDisconnected() { mPbapClientBinder.cleanup(); int state = mPbapClientBinder.getConnectionState(mTestDevice, mAttributionSource); verify(mMockService, times(0)).getConnectionState(any(BluetoothDevice.class)); verify(mMockService, never()).getConnectionState(any(BluetoothDevice.class)); assertThat(state).isEqualTo(BluetoothProfile.STATE_DISCONNECTED); } Loading @@ -172,7 +172,7 @@ public class PbapClientBinderTest { boolean result = mPbapClientBinder.setConnectionPolicy( mTestDevice, connectionPolicy, mAttributionSource); verify(mMockService, times(0)).setConnectionPolicy(any(BluetoothDevice.class), anyInt()); verify(mMockService, never()).setConnectionPolicy(any(BluetoothDevice.class), anyInt()); assertThat(result).isFalse(); } Loading @@ -180,7 +180,7 @@ public class PbapClientBinderTest { public void testGetConnectionPolicy_afterCleanup_returnsUnknown() { mPbapClientBinder.cleanup(); int result = mPbapClientBinder.getConnectionPolicy(mTestDevice, mAttributionSource); verify(mMockService, times(0)).getConnectionPolicy(any(BluetoothDevice.class)); verify(mMockService, never()).getConnectionPolicy(any(BluetoothDevice.class)); assertThat(result).isEqualTo(BluetoothProfile.CONNECTION_POLICY_UNKNOWN); } } Loading
android/app/src/com/android/bluetooth/pbapclient/PbapClientBinder.java +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ import java.util.Collections; import java.util.List; /** Handler for incoming service calls destined for PBAP Client */ public class PbapClientBinder extends IBluetoothPbapClient.Stub implements IProfileServiceBinder { class PbapClientBinder extends IBluetoothPbapClient.Stub implements IProfileServiceBinder { private static final String TAG = PbapClientBinder.class.getSimpleName(); private PbapClientService mService; Loading
android/app/tests/unit/src/com/android/bluetooth/pbapclient/PbapClientBinderTest.java +8 −8 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyInt; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import android.bluetooth.BluetoothAdapter; Loading Loading @@ -127,7 +127,7 @@ public class PbapClientBinderTest { public void testConnect_afterCleanup_returnsFalse() { mPbapClientBinder.cleanup(); boolean result = mPbapClientBinder.connect(mTestDevice, mAttributionSource); verify(mMockService, times(0)).connect(any(BluetoothDevice.class)); verify(mMockService, never()).connect(any(BluetoothDevice.class)); assertThat(result).isFalse(); } Loading @@ -135,7 +135,7 @@ public class PbapClientBinderTest { public void testDisconnect_afterCleanup_returnsFalse() { mPbapClientBinder.cleanup(); boolean result = mPbapClientBinder.disconnect(mTestDevice, mAttributionSource); verify(mMockService, times(0)).disconnect(any(BluetoothDevice.class)); verify(mMockService, never()).disconnect(any(BluetoothDevice.class)); assertThat(result).isFalse(); } Loading @@ -143,7 +143,7 @@ public class PbapClientBinderTest { public void testGetConnectedDevices_afterCleanup_returnsEmptyList() { mPbapClientBinder.cleanup(); List<BluetoothDevice> devices = mPbapClientBinder.getConnectedDevices(mAttributionSource); verify(mMockService, times(0)).getConnectedDevices(); verify(mMockService, never()).getConnectedDevices(); assertThat(devices).isEmpty(); } Loading @@ -153,7 +153,7 @@ public class PbapClientBinderTest { int[] states = new int[] {BluetoothProfile.STATE_CONNECTED}; List<BluetoothDevice> devices = mPbapClientBinder.getDevicesMatchingConnectionStates(states, mAttributionSource); verify(mMockService, times(0)).getDevicesMatchingConnectionStates(any(int[].class)); verify(mMockService, never()).getDevicesMatchingConnectionStates(any(int[].class)); assertThat(devices).isEmpty(); } Loading @@ -161,7 +161,7 @@ public class PbapClientBinderTest { public void testGetConnectionState_afterCleanup_returnsDisconnected() { mPbapClientBinder.cleanup(); int state = mPbapClientBinder.getConnectionState(mTestDevice, mAttributionSource); verify(mMockService, times(0)).getConnectionState(any(BluetoothDevice.class)); verify(mMockService, never()).getConnectionState(any(BluetoothDevice.class)); assertThat(state).isEqualTo(BluetoothProfile.STATE_DISCONNECTED); } Loading @@ -172,7 +172,7 @@ public class PbapClientBinderTest { boolean result = mPbapClientBinder.setConnectionPolicy( mTestDevice, connectionPolicy, mAttributionSource); verify(mMockService, times(0)).setConnectionPolicy(any(BluetoothDevice.class), anyInt()); verify(mMockService, never()).setConnectionPolicy(any(BluetoothDevice.class), anyInt()); assertThat(result).isFalse(); } Loading @@ -180,7 +180,7 @@ public class PbapClientBinderTest { public void testGetConnectionPolicy_afterCleanup_returnsUnknown() { mPbapClientBinder.cleanup(); int result = mPbapClientBinder.getConnectionPolicy(mTestDevice, mAttributionSource); verify(mMockService, times(0)).getConnectionPolicy(any(BluetoothDevice.class)); verify(mMockService, never()).getConnectionPolicy(any(BluetoothDevice.class)); assertThat(result).isEqualTo(BluetoothProfile.CONNECTION_POLICY_UNKNOWN); } }