Remove hidden Bluetooth dependencies

Bug: 217736913
Test: pre-submit
Change-Id: Ib4e12e8e350ffa08b48f58e8256991d7ed4fa013
This commit is contained in:
William Escande
2022-02-16 20:00:59 +01:00
parent 5d17cfd938
commit a95180f228
6 changed files with 17 additions and 6 deletions

View File

@@ -24,6 +24,7 @@ import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.content.Intent;
import android.os.Parcel;
import com.android.settings.testutils.shadow.ShadowBluetoothAdapter;
@@ -40,12 +41,22 @@ import org.robolectric.annotation.Config;
@Config(shadows = {ShadowBluetoothAdapter.class})
public class BluetoothPairingControllerTest {
private final BluetoothClass mBluetoothClass =
new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE);
createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE);
@Mock
private BluetoothDevice mBluetoothDevice;
private Context mContext;
private BluetoothPairingController mBluetoothPairingController;
private BluetoothClass createBtClass(int deviceClass) {
Parcel p = Parcel.obtain();
p.writeInt(deviceClass);
p.setDataPosition(0); // reset position of parcel before passing to constructor
BluetoothClass bluetoothClass = BluetoothClass.CREATOR.createFromParcel(p);
p.recycle();
return bluetoothClass;
}
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);