diff options
author | Yorke Lee <yorkelee@google.com> | 2013-11-19 16:39:58 -0800 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2014-03-01 17:55:56 +0000 |
commit | bb910c6cef3833163543622e7af2c102546688ec (patch) | |
tree | 9d8cfe96048dadad9e9ae7961fe598df0d9dc5d6 | |
parent | b0b153f5fe5833d1a3b102e93e6e27481a90e4f7 (diff) |
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 ab9ae646ad4926b69dc02502861e8919b2cdb711)
-rw-r--r-- | src/com/android/dialer/interactions/UndemoteOutgoingCallReceiver.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/com/android/dialer/interactions/UndemoteOutgoingCallReceiver.java b/src/com/android/dialer/interactions/UndemoteOutgoingCallReceiver.java index 30d01d2f8..fb9b1d1aa 100644 --- a/src/com/android/dialer/interactions/UndemoteOutgoingCallReceiver.java +++ b/src/com/android/dialer/interactions/UndemoteOutgoingCallReceiver.java @@ -41,16 +41,16 @@ 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 Thread thread = new Thread() { + @Override + public void run() { + final long id = getContactIdFromPhoneNumber(context, number); + if (id != NO_CONTACT_FOUND) { undemoteContactWithId(context, id); } - }; - thread.start(); - } + } + }; + thread.start(); } } |