Fix test case fail in CachedBluetoothDeviceTest

Bug: 188948300
Test: make RunSettingsLibRoboTests
Change-Id: Ib42c9b4f840b64ffa2ceaf981dfd76d3195a18b2
This commit is contained in:
Hugh Chen
2021-05-31 19:06:45 +08:00
parent 0a40c03eb1
commit 2d71a9a5cd

View File

@@ -30,6 +30,7 @@ import static org.mockito.Mockito.when;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothStatusCodes;
import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.media.AudioManager;
@@ -738,7 +739,7 @@ public class CachedBluetoothDeviceTest {
doAnswer(invocation -> alias[0]).when(mDevice).getAlias();
doAnswer(invocation -> {
alias[0] = (String) invocation.getArguments()[0];
return true;
return BluetoothStatusCodes.SUCCESS;
}).when(mDevice).setAlias(anyString());
when(mDevice.getName()).thenReturn(DEVICE_NAME);
CachedBluetoothDevice cachedBluetoothDevice =