diff options
author | Anne Rong <annerong@google.com> | 2015-09-17 16:59:43 -0700 |
---|---|---|
committer | Anne Rong <annerong@google.com> | 2015-09-17 16:59:43 -0700 |
commit | 204f7f076ac79684484044f3c534c6b2fe71b7e4 (patch) | |
tree | 6dc6198831158b4f23beba9292e2a3d4b8a6dc42 | |
parent | ad9a5f36ed22b45c31fce53f98ce3af00a4df020 (diff) |
FilteredNumberAsyncQueryHandler should not crash if number is invalid
Bug: 24176751
Change-Id: Ic019d2e6276b94e373e28412443903c6e87c2f1a
-rw-r--r-- | InCallUI/src/com/android/incallui/CallList.java | 30 |
1 files changed, 17 insertions, 13 deletions
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); } |