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

Commit 6162f2a1 authored by Grant Menke's avatar Grant Menke Committed by Automerger Merge Worker
Browse files

Remove BIND_TO_IN_CALL_EMERGENCY_ERROR_UUID anomaly report. am: 5453374b

parents ad0706fe 5453374b
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -98,14 +98,6 @@ public class InCallController extends CallsManagerListenerBase implements
            UUID.fromString("0c2adf96-353a-433c-afe9-1e5564f304f9");
    public static final String SET_IN_CALL_ADAPTER_ERROR_MSG =
            "Exception thrown while setting the in-call adapter.";
    public static final UUID BIND_TO_IN_CALL_ERROR_UUID =
            UUID.fromString("1261231d-b16a-4e0c-a322-623f8bb8e599");
    public static final String BIND_TO_IN_CALL_ERROR_MSG =
            "Failed to connect when attempting to bind to InCall.";
    public static final UUID BIND_TO_IN_CALL_EMERGENCY_ERROR_UUID =
            UUID.fromString("9ec8f1f0-3f0b-4079-9e9f-325f1262a8c7");
    public static final String BIND_TO_IN_CALL_EMERGENCY_ERROR_MSG =
            "Outgoing emergency call failed to connect when attempting to bind to InCall.";

    @VisibleForTesting
    public void setAnomalyReporterAdapter(AnomalyReporterAdapter mAnomalyReporterAdapter){
@@ -349,10 +341,6 @@ public class InCallController extends CallsManagerListenerBase implements
                        | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS
                        | Context.BIND_SCHEDULE_LIKE_TOP_APP, userToBind)) {
                Log.w(this, "Failed to connect.");
                if (call != null && call.isEmergencyCall()) {
                    mAnomalyReporter.reportAnomaly(BIND_TO_IN_CALL_EMERGENCY_ERROR_UUID,
                            BIND_TO_IN_CALL_EMERGENCY_ERROR_MSG);
                }
                mIsConnected = false;
            }

+0 −31
Original line number Diff line number Diff line
@@ -426,37 +426,6 @@ public class InCallControllerTests extends TelecomTestCase {
                TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS));
    }

    @MediumTest
    @Test
    public void testBindToService_OutgoingEmergCall_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.isEmergencyCall()).thenReturn(true);
        when(mMockContext.getSystemService(eq(UserManager.class)))
            .thenReturn(mMockUserManager);
        when(mMockUserManager.isQuietModeEnabled(any(UserHandle.class))).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_EMERGENCY_ERROR_UUID,
                InCallController.BIND_TO_IN_CALL_EMERGENCY_ERROR_MSG);
    }

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