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

Commit bb910c6c authored by Yorke Lee's avatar Yorke Lee Committed by Jay Shrauner
Browse files

Fix ANR in UndemoteOutgoingCallReceiver

Querying the contacts provider for the contact id should happen
in a new thread as well.

Bug: 11773499
Change-Id: I715e7e9b4a650efbd708d4ad3793dad742b74a14
(cherry picked from commit ab9ae646)
parent b0b153f5
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -41,18 +41,18 @@ public class UndemoteOutgoingCallReceiver extends BroadcastReceiver {
            if (TextUtils.isEmpty(number)) {
                return;
            }
            final long id = getContactIdFromPhoneNumber(context, number);
            if (id != NO_CONTACT_FOUND) {
            final Thread thread = new Thread() {
                @Override
                public void run() {
                    final long id = getContactIdFromPhoneNumber(context, number);
                    if (id != NO_CONTACT_FOUND) {
                        undemoteContactWithId(context, id);
                    }
                }
            };
            thread.start();
        }
    }
    }

    private void undemoteContactWithId(Context context, long id) {
        final ContentValues cv = new ContentValues(1);