summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorAnne Rong <annerong@google.com>2015-09-17 16:59:43 -0700
committerAnne Rong <annerong@google.com>2015-09-17 16:59:43 -0700
commit204f7f076ac79684484044f3c534c6b2fe71b7e4 (patch)
tree6dc6198831158b4f23beba9292e2a3d4b8a6dc42 /InCallUI
parentad9a5f36ed22b45c31fce53f98ce3af00a4df020 (diff)
FilteredNumberAsyncQueryHandler should not crash if number is invalid
Bug: 24176751 Change-Id: Ic019d2e6276b94e373e28412443903c6e87c2f1a
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/CallList.java30
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);
}