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

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

Merge "DO NOT MERGE Don't show "Respond via SMS" for missed SIP calls." into mnc-dr-dev

parents 370a7a37 50950a4d
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -204,10 +204,12 @@ public class MissedCallNotifierImpl extends CallsManagerListenerBase implements
                        mContext.getString(R.string.notification_missedCall_call_back),
                        createCallBackPendingIntent(handleUri));

                if (canRespondViaSms(call)) {
                    builder.addAction(R.drawable.ic_message_24dp,
                            mContext.getString(R.string.notification_missedCall_message),
                            createSendSmsFromNotificationPendingIntent(handleUri));
                }
            }

            Bitmap photoIcon = call.getPhotoIcon();
            if (photoIcon != null) {
@@ -366,6 +368,12 @@ public class MissedCallNotifierImpl extends CallsManagerListenerBase implements
        notification.defaults |= Notification.DEFAULT_LIGHTS;
    }

    private boolean canRespondViaSms(Call call) {
        // Only allow respond-via-sms for "tel:" calls.
        return call.getHandle() != null &&
                PhoneAccount.SCHEME_TEL.equals(call.getHandle().getScheme());
    }

    /**
     * Adds the missed call notification on startup if there are unread missed calls.
     */