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

Commit d8ee2bfa authored by Tyler Gunn's avatar Tyler Gunn Committed by Android Git Automerger
Browse files

am b424457b: Merge "DO NOT MERGE Don\'t show "Respond via SMS" for missed SIP...

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

* commit 'b424457b':
  DO NOT MERGE Don't show "Respond via SMS" for missed SIP calls.
parents bcb0ba60 b424457b
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -256,10 +256,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) {
@@ -424,6 +426,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.
     */