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

Commit cf1b37c6 authored by Yorke Lee's avatar Yorke Lee Committed by Android (Google) Code Review
Browse files

Merge "Create handle with correct scheme in MissedCallNotifier" into lmp-dev

parents 27d9e273 0c345e9b
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ import android.provider.CallLog;
import android.provider.CallLog.Calls;
import android.telecom.CallState;
import android.telecom.DisconnectCause;
import android.telecom.PhoneAccount;
import android.telephony.PhoneNumberUtils;
import android.text.BidiFormatter;
import android.text.TextDirectionHeuristics;
import android.text.TextUtils;
@@ -278,13 +280,19 @@ class MissedCallNotifier extends CallsManagerListenerBase {
                    try {
                        while (cursor.moveToNext()) {
                            // Get data about the missed call from the cursor
                            Uri handle = Uri.parse(cursor.getString(
                                    cursor.getColumnIndexOrThrow(Calls.NUMBER)));
                            int presentation = cursor.getInt(cursor.getColumnIndexOrThrow(
                            final String handleString = cursor.getString(
                                    cursor.getColumnIndexOrThrow(Calls.NUMBER));
                            final int presentation = cursor.getInt(cursor.getColumnIndexOrThrow(
                                    Calls.NUMBER_PRESENTATION));

                            if (presentation != Calls.PRESENTATION_ALLOWED) {
                            final Uri handle;
                            if (presentation != Calls.PRESENTATION_ALLOWED
                                    || TextUtils.isEmpty(handleString)) {
                                handle = null;
                            } else {
                                handle = Uri.fromParts(PhoneNumberUtils.isUriNumber(handleString) ?
                                        PhoneAccount.SCHEME_SIP : PhoneAccount.SCHEME_TEL,
                                                handleString, null);
                            }

                            // Convert the data to a call object