Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed26173a authored by William Escande's avatar William Escande
Browse files

InCallService: Refresh test and use injection

Bug: 330247213
Fix: 330247213
Test: atest BluetoothInstrumentationTests:BluetoothInCallServiceTest
Flag: TEST_ONLY
Change-Id: I323975fc8ab438ded04f86d72059079996000c24
parent 3754e4c3
Loading
Loading
Loading
Loading
+21 −3
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ public class BluetoothInCallService extends InCallService {

    private static BluetoothInCallService sInstance = null;

    public CallInfo mCallInfo = new CallInfo();
    private final CallInfo mCallInfo;

    protected boolean mOnCreateCalled = false;

@@ -346,12 +346,31 @@ public class BluetoothInCallService extends InCallService {
        return super.onUnbind(intent);
    }

    public BluetoothInCallService() {
    private BluetoothInCallService(CallInfo callInfo) {
        Log.i(TAG, "BluetoothInCallService is created");
        mCallInfo = Objects.requireNonNullElse(callInfo, new CallInfo());
        sInstance = this;
        mExecutor = Executors.newSingleThreadExecutor();
    }

    public BluetoothInCallService() {
        this(null);
    }

    @VisibleForTesting
    BluetoothInCallService(
            Context context,
            CallInfo callInfo,
            BluetoothHeadsetProxy headset,
            BluetoothLeCallControlProxy leCallControl) {
        this(callInfo);
        mBluetoothHeadset = headset;
        mBluetoothLeCallControl = leCallControl;
        attachBaseContext(context);
        mTelephonyManager = getSystemService(TelephonyManager.class);
        mTelecomManager = getSystemService(TelecomManager.class);
    }

    public static BluetoothInCallService getInstance() {
        return sInstance;
    }
@@ -1551,7 +1570,6 @@ public class BluetoothInCallService extends InCallService {
            return null;
        }
    }
    ;

    @VisibleForTesting
    public void setBluetoothLeCallControl(BluetoothLeCallControlProxy bluetoothTbs) {
+416 −586

File changed.

Preview size limit exceeded, changes collapsed.