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

Commit 99bef95d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fixed Integer to null conversion" am: 8c0f867b

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1741178

Change-Id: I143e2390977cc569f8620368c622bf8525b45e97
parents 388140eb 8c0f867b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ public class BluetoothCall {
        mCall.removeListener(listener);
    }

    public int getGenericConferenceActiveChildCallId() {
    public Integer getGenericConferenceActiveChildCallId() {
        return System.identityHashCode(mCall.getGenericConferenceActiveChildCall());
    }

@@ -284,7 +284,7 @@ public class BluetoothCall {
        return getDetails().hasProperty(Call.Details.PROPERTY_IS_EXTERNAL_CALL);
    }

    public int getId() {
    public Integer getId() {
        return System.identityHashCode(mCall);
    }

+3 −3
Original line number Diff line number Diff line
@@ -832,7 +832,7 @@ public class BluetoothInCallService extends InCallService {
                numHeldCalls = 1;  // Merge is available, so expose via numHeldCalls.
            }

            for (int id : activeCall.getChildrenIds()) {
            for (Integer id : activeCall.getChildrenIds()) {
                // Held BluetoothCall has changed due to it being combined into a CDMA conference.
                // Keep track of this and ignore any future update since it doesn't really count
                // as a BluetoothCall change.
@@ -978,7 +978,7 @@ public class BluetoothInCallService extends InCallService {
    }

    @VisibleForTesting
    public BluetoothCall getBluetoothCallById(int id) {
    public BluetoothCall getBluetoothCallById(Integer id) {
        if (mBluetoothCallHashMap.containsKey(id)) {
            return mBluetoothCallHashMap.get(id);
        }
@@ -988,7 +988,7 @@ public class BluetoothInCallService extends InCallService {
    @VisibleForTesting
    public List<BluetoothCall> getBluetoothCallsByIds(List<Integer> ids) {
        List<BluetoothCall> calls = new ArrayList<>();
        for (int id : ids) {
        for (Integer id : ids) {
            BluetoothCall call = getBluetoothCallById(id);
            if (!mCallInfo.isNullCall(call)) {
                calls.add(call);
+8 −8
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ public class BluetoothInCallServiceTest {
        addCallCapability(parentCall, Connection.CAPABILITY_MERGE_CONFERENCE);
        addCallCapability(parentCall, Connection.CAPABILITY_SWAP_CONFERENCE);
        removeCallCapability(parentCall, Connection.CAPABILITY_CONFERENCE_HAS_NO_CHILDREN);
        int confCall1Id = confCall1.getId();
        Integer confCall1Id = confCall1.getId();
        when(parentCall.getGenericConferenceActiveChildCallId())
                .thenReturn(confCall1Id);
        when(parentCall.isConference()).thenReturn(true);
@@ -315,7 +315,7 @@ public class BluetoothInCallServiceTest {
                confCall2.getId());
        when(parentCall.getChildrenIds()).thenReturn(childrenIds);
        //Add links from child calls to parent
        int parentId = parentCall.getId();
        Integer parentId = parentCall.getId();
        when(confCall1.getParentId()).thenReturn(parentId);
        when(confCall2.getParentId()).thenReturn(parentId);

@@ -369,14 +369,14 @@ public class BluetoothInCallServiceTest {
        addCallCapability(parentCall, Connection.CAPABILITY_SWAP_CONFERENCE);
        removeCallCapability(parentCall, Connection.CAPABILITY_CONFERENCE_HAS_NO_CHILDREN);

        int foregroundCallId = foregroundCall.getId();
        Integer foregroundCallId = foregroundCall.getId();
        when(parentCall.getGenericConferenceActiveChildCallId()).thenReturn(foregroundCallId);
        when(parentCall.isConference()).thenReturn(true);
        List<Integer> childrenIds = Arrays.asList(foregroundCall.getId(),
                heldCall.getId());
        when(parentCall.getChildrenIds()).thenReturn(childrenIds);
        //Add links from child calls to parent
        int parentId = parentCall.getId();
        Integer parentId = parentCall.getId();
        when(foregroundCall.getParentId()).thenReturn(parentId);
        when(heldCall.getParentId()).thenReturn(parentId);

@@ -422,7 +422,7 @@ public class BluetoothInCallServiceTest {
                confCall2.getId());
        when(parentCall.getChildrenIds()).thenReturn(childrenIds);
        //Add links from child calls to parent
        int parentId = parentCall.getId();
        Integer parentId = parentCall.getId();
        when(confCall1.getParentId()).thenReturn(parentId);
        when(confCall2.getParentId()).thenReturn(parentId);

@@ -634,7 +634,7 @@ public class BluetoothInCallServiceTest {
        mBluetoothInCallService.onCallAdded(childCall2);

        addCallCapability(parentCall, Connection.CAPABILITY_MANAGE_CONFERENCE);
        int parentId = parentCall.getId();
        Integer parentId = parentCall.getId();
        when(childCall1.getParentId()).thenReturn(parentId);
        when(childCall2.getParentId()).thenReturn(parentId);

@@ -1038,7 +1038,7 @@ public class BluetoothInCallServiceTest {
        mBluetoothInCallService.onCallAdded(parentCall);
        mBluetoothInCallService.onCallAdded(activeCall);
        mBluetoothInCallService.onCallAdded(heldCall);
        int parentId = parentCall.getId();
        Integer parentId = parentCall.getId();
        when(activeCall.getParentId()).thenReturn(parentId);
        when(heldCall.getParentId()).thenReturn(parentId);

@@ -1168,7 +1168,7 @@ public class BluetoothInCallServiceTest {

    private BluetoothCall getMockCall() {
        BluetoothCall call = mock(com.android.bluetooth.telephony.BluetoothCall.class);
        int uuid = UUID.randomUUID().hashCode();
        Integer uuid = UUID.randomUUID().hashCode();
        when(call.getId()).thenReturn(uuid);
        return call;
    }