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

Commit ed96db50 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Remove BIND_TO_IN_CALL_ERROR_UUID anomaly report." into udc-dev

parents 44821410 d4c90c3c
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -352,9 +352,6 @@ public class InCallController extends CallsManagerListenerBase implements
                if (call != null && call.isEmergencyCall()) {
                    mAnomalyReporter.reportAnomaly(BIND_TO_IN_CALL_EMERGENCY_ERROR_UUID,
                            BIND_TO_IN_CALL_EMERGENCY_ERROR_MSG);
                } else {
                    mAnomalyReporter.reportAnomaly(BIND_TO_IN_CALL_ERROR_UUID,
                            BIND_TO_IN_CALL_ERROR_MSG);
                }
                mIsConnected = false;
            }
+0 −26
Original line number Diff line number Diff line
@@ -426,32 +426,6 @@ public class InCallControllerTests extends TelecomTestCase {
                TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS));
    }

    @MediumTest
    @Test
    public void testBindToService_OutgoingCall_FailToBind_AnomalyReported() throws Exception {
        mInCallController.setAnomalyReporterAdapter(mAnomalyReporterAdapter);
        when(mMockContext.bindServiceAsUser(any(Intent.class), any(ServiceConnection.class),
                anyInt(), any(UserHandle.class))).thenReturn(false);
        Bundle callExtras = new Bundle();
        callExtras.putBoolean("whatever", true);

        when(mMockCallsManager.getCurrentUserHandle()).thenReturn(mUserHandle);
        when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager);
        when(mMockCallsManager.isInEmergencyCall()).thenReturn(false);
        when(mMockCall.isIncoming()).thenReturn(false);
        when(mMockCall.getTargetPhoneAccount()).thenReturn(PA_HANDLE);
        when(mMockCall.getIntentExtras()).thenReturn(callExtras);
        when(mMockCall.isExternalCall()).thenReturn(false);
        when(mTimeoutsAdapter.getEmergencyCallbackWindowMillis(any(ContentResolver.class)))
                .thenReturn(300_000L);

        setupMockPackageManager(false /* default */, true /* system */, false /* external calls */);
        mInCallController.bindToServices(mMockCall);

        verify(mAnomalyReporterAdapter).reportAnomaly(InCallController.BIND_TO_IN_CALL_ERROR_UUID,
                InCallController.BIND_TO_IN_CALL_ERROR_MSG);
    }

    @MediumTest
    @Test
    public void testBindToService_OutgoingEmergCall_FailToBind_AnomalyReported() throws Exception {