Loading src/com/android/settings/bluetooth/BluetoothPairingController.java +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener, mType = intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.ERROR); mPasskey = intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_KEY, BluetoothDevice.ERROR); mDeviceName = mBluetoothManager.getCachedDeviceManager().findDevice(mDevice).getName(); mDeviceName = mBluetoothManager.getCachedDeviceManager().getName(mDevice); mPbapClientProfile = mBluetoothManager.getProfileManager().getPbapClientProfile(); mPasskeyFormatted = formatKey(mPasskey); } Loading tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingControllerTest.java +0 −14 Original line number Diff line number Diff line Loading @@ -15,13 +15,10 @@ */ package com.android.settings.bluetooth; import static com.google.common.truth.Truth.assertThat; import static android.bluetooth.BluetoothDevice.PAIRING_VARIANT_CONSENT; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.bluetooth.BluetoothDevice; import android.content.Context; Loading @@ -30,7 +27,6 @@ import android.content.Intent; import com.android.settings.testutils.SettingsRobolectricTestRunner; import com.android.settings.testutils.shadow.ShadowBluetoothAdapter; import com.android.settings.testutils.shadow.ShadowBluetoothPan; import com.android.settingslib.bluetooth.LocalBluetoothManager; import org.junit.Before; import org.junit.Test; Loading @@ -43,12 +39,10 @@ import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) @Config(shadows = {ShadowBluetoothPan.class, ShadowBluetoothAdapter.class}) public class BluetoothPairingControllerTest { private final static String DEVICE_NAME = "TestName"; @Mock private BluetoothDevice mBluetoothDevice; private Context mContext; private BluetoothPairingController mBluetoothPairingController; private LocalBluetoothManager mBluetoothManager; @Before public void setUp() { Loading @@ -57,9 +51,6 @@ public class BluetoothPairingControllerTest { mContext = RuntimeEnvironment.application; final Intent intent = new Intent(); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mBluetoothManager = Utils.getLocalBtManager(mContext); when(mBluetoothDevice.getAliasName()).thenReturn(DEVICE_NAME); mBluetoothManager.getCachedDeviceManager().addDevice(mBluetoothDevice); mBluetoothPairingController = spy(new BluetoothPairingController(intent, mContext)); } Loading @@ -72,9 +63,4 @@ public class BluetoothPairingControllerTest { verify(mBluetoothDevice).setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); } @Test public void onGetDeviceName() { assertThat(mBluetoothPairingController.getDeviceName()).isEqualTo(DEVICE_NAME); } } Loading
src/com/android/settings/bluetooth/BluetoothPairingController.java +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener, mType = intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.ERROR); mPasskey = intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_KEY, BluetoothDevice.ERROR); mDeviceName = mBluetoothManager.getCachedDeviceManager().findDevice(mDevice).getName(); mDeviceName = mBluetoothManager.getCachedDeviceManager().getName(mDevice); mPbapClientProfile = mBluetoothManager.getProfileManager().getPbapClientProfile(); mPasskeyFormatted = formatKey(mPasskey); } Loading
tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingControllerTest.java +0 −14 Original line number Diff line number Diff line Loading @@ -15,13 +15,10 @@ */ package com.android.settings.bluetooth; import static com.google.common.truth.Truth.assertThat; import static android.bluetooth.BluetoothDevice.PAIRING_VARIANT_CONSENT; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.bluetooth.BluetoothDevice; import android.content.Context; Loading @@ -30,7 +27,6 @@ import android.content.Intent; import com.android.settings.testutils.SettingsRobolectricTestRunner; import com.android.settings.testutils.shadow.ShadowBluetoothAdapter; import com.android.settings.testutils.shadow.ShadowBluetoothPan; import com.android.settingslib.bluetooth.LocalBluetoothManager; import org.junit.Before; import org.junit.Test; Loading @@ -43,12 +39,10 @@ import org.robolectric.annotation.Config; @RunWith(SettingsRobolectricTestRunner.class) @Config(shadows = {ShadowBluetoothPan.class, ShadowBluetoothAdapter.class}) public class BluetoothPairingControllerTest { private final static String DEVICE_NAME = "TestName"; @Mock private BluetoothDevice mBluetoothDevice; private Context mContext; private BluetoothPairingController mBluetoothPairingController; private LocalBluetoothManager mBluetoothManager; @Before public void setUp() { Loading @@ -57,9 +51,6 @@ public class BluetoothPairingControllerTest { mContext = RuntimeEnvironment.application; final Intent intent = new Intent(); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mBluetoothManager = Utils.getLocalBtManager(mContext); when(mBluetoothDevice.getAliasName()).thenReturn(DEVICE_NAME); mBluetoothManager.getCachedDeviceManager().addDevice(mBluetoothDevice); mBluetoothPairingController = spy(new BluetoothPairingController(intent, mContext)); } Loading @@ -72,9 +63,4 @@ public class BluetoothPairingControllerTest { verify(mBluetoothDevice).setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); } @Test public void onGetDeviceName() { assertThat(mBluetoothPairingController.getDeviceName()).isEqualTo(DEVICE_NAME); } }