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

Commit ef324a3f authored by Yorke Lee's avatar Yorke Lee Committed by Android Git Automerger
Browse files

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

* commit 'cf1b37c6':
  Create handle with correct scheme in MissedCallNotifier
parents e5cbf7d6 cf1b37c6
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