From 758ba199a0a2bce7c69bfcc751bb16138bb6e609 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Wed, 30 Mar 2016 19:18:18 +0100 Subject: [DO NOT MERGE] Fix Dialer crash loop for caller id in personal contact directory The bug is dialer queries CP2 for alternative name by lookup key of personal directory CP2 throws IllegalArgumentException as the lookup key is not found locally slient IllegalArgumentException since alternative name is not very important to crash dialer. (It's a fix by reverting some changes in ag/880910) Bug:27905000 Change-Id: I1d61f52df63d93c9c7da436c7f2da2bdf3cced0c --- src/com/android/dialer/calllog/ContactInfoHelper.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/com/android/dialer') diff --git a/src/com/android/dialer/calllog/ContactInfoHelper.java b/src/com/android/dialer/calllog/ContactInfoHelper.java index 6e84a92f9..b0ef0abf4 100644 --- a/src/com/android/dialer/calllog/ContactInfoHelper.java +++ b/src/com/android/dialer/calllog/ContactInfoHelper.java @@ -224,6 +224,8 @@ public class ContactInfoHelper { if (cursor != null && cursor.moveToFirst()) { return cursor.getString(PhoneQuery.NAME_ALTERNATIVE); } + } catch (IllegalArgumentException e) { + // Avoid dialer crash when lookup key is not valid } finally { if (cursor != null) { cursor.close(); -- cgit v1.2.3