Remove BIND_TO_IN_CALL_EMERGENCY_ERROR_UUID anomaly report.

Some ICS may fail to bind and that is normal. This anomaly report has already been removed for non-emergency calls. This CL removes this anomaly report trigger for emergency calls as well as cleaning up the variables that were created for reporting both emergency and non-emergency calls for this type of anomaly report.

Test: Run unit tests InCallControllerTests
Bug: 275168097
Change-Id: I1eefca89792a8be8489e312641af6e865f102261
diff --git a/src/com/android/server/telecom/InCallController.java b/src/com/android/server/telecom/InCallController.java
index 74b104f..2fc59fa 100644
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -98,14 +98,6 @@
             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 @@
                         | 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;
             }
 
diff --git a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
index ebc93de..a08184b 100644
--- a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
+++ b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java
@@ -428,37 +428,6 @@
 
     @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 {
         Bundle callExtras = new Bundle();
         callExtras.putBoolean("whatever", true);