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

Commit 3cc4b4b1 authored by Grace Jia's avatar Grace Jia Committed by Automerger Merge Worker
Browse files

Suppress "dialer crashed" notification if the crashed dialer is system am: 98faa9a3

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/12346112

Change-Id: I25f81bb75e311e4e5f2f1d88a8d64a762e258299
parents 1fbf0eb1 98faa9a3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1901,6 +1901,10 @@ public class InCallController extends CallsManagerListenerBase {
    private void sendCrashedInCallServiceNotification(String packageName) {
        PackageManager packageManager = mContext.getPackageManager();
        CharSequence appName;
        String systemDialer = mDefaultDialerCache.getSystemDialerApplication();
        if ((systemDialer != null) && systemDialer.equals(packageName)) {
            return;
        }
        try {
            appName = packageManager.getApplicationLabel(
                    packageManager.getApplicationInfo(packageName, 0));
+3 −1
Original line number Diff line number Diff line
@@ -624,6 +624,7 @@ public class InCallControllerTests extends TelecomTestCase {
                any(Intent.class), any(ServiceConnection.class), anyInt(), any(UserHandle.class)))
                .thenReturn(true);
        when(mMockContext.getApplicationInfo()).thenReturn(applicationInfo);
        when(mDefaultDialerCache.getDefaultDialerApplication(CURRENT_USER_ID)).thenReturn(DEF_PKG);

        setupMockPackageManager(true /* default */, true /* system */, false /* external calls */);
        mInCallController.bindToServices(mMockCall);
@@ -650,7 +651,7 @@ public class InCallControllerTests extends TelecomTestCase {

        verify(mNotificationManager).notify(eq(NOTIFICATION_TAG),
                eq(IN_CALL_SERVICE_NOTIFICATION_ID), any(Notification.class));
        verify(mCallInfo).addInCallService(eq(sysDialerComponentName.flattenToShortString()),
        verify(mCallInfo).addInCallService(eq(defDialerComponentName.flattenToShortString()),
                anyInt(), anyLong(), eq(true));

        ArgumentCaptor<Intent> bindIntentCaptor2 = ArgumentCaptor.forClass(Intent.class);
@@ -660,6 +661,7 @@ public class InCallControllerTests extends TelecomTestCase {
                eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE
                        | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS),
                eq(UserHandle.CURRENT));
        assertEquals(sysDialerComponentName, bindIntentCaptor2.getValue().getComponent());
    }

    /**