From 204f7f076ac79684484044f3c534c6b2fe71b7e4 Mon Sep 17 00:00:00 2001 From: Anne Rong Date: Thu, 17 Sep 2015 16:59:43 -0700 Subject: FilteredNumberAsyncQueryHandler should not crash if number is invalid Bug: 24176751 Change-Id: Ic019d2e6276b94e373e28412443903c6e87c2f1a --- InCallUI/src/com/android/incallui/CallList.java | 30 ++++++++++++++----------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/CallList.java b/InCallUI/src/com/android/incallui/CallList.java index 018ac10ca..b93744047 100644 --- a/InCallUI/src/com/android/incallui/CallList.java +++ b/InCallUI/src/com/android/incallui/CallList.java @@ -102,22 +102,26 @@ public class CallList { } }; handler.postDelayed(runnable, BLOCK_QUERY_TIMEOUT_MS); - mFilteredQueryHandler.isBlocked( - new FilteredNumberAsyncQueryHandler.OnCheckBlockedListener() { - @Override - public void onCheckComplete(final Integer id) { - if (!hasTimedOut.get()) { - handler.removeCallbacks(runnable); - } - if (id == null) { + try { + mFilteredQueryHandler.isBlocked( + new FilteredNumberAsyncQueryHandler.OnCheckBlockedListener() { + @Override + public void onCheckComplete(final Integer id) { if (!hasTimedOut.get()) { - onCallAddedInternal(call); + handler.removeCallbacks(runnable); + } + if (id == null) { + if (!hasTimedOut.get()) { + onCallAddedInternal(call); + } + } else { + call.blockCall(); } - } else { - call.blockCall(); } - } - }, null, call.getNumber(), countryIso); + }, null, call.getNumber(), countryIso); + } catch (IllegalArgumentException e) { + Log.d(this, "onCallAdded: invalid number, skipping block checking"); + } } else { onCallAddedInternal(call); } -- cgit v1.2.3