summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorAnne Rong <annerong@google.com>2015-09-18 18:54:39 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-09-18 18:54:39 +0000
commit7d5ff522a0f46614f0fa1cb101d442eeef8afe7a (patch)
tree7ee8f66c62c27f0cddea8b20b4ecda9e464fb0fe /InCallUI
parentdd3dc41b589977bca9621484aed15a7f1508e7f6 (diff)
parent3e58e2ec82f42799fb8a0ff2227ac54fa45e1b03 (diff)
Merge "Refactor FilteredNumberAsyncQueryHandler.isBlocked" into ub-contactsdialer-a-dev
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/CallList.java35
1 files changed, 19 insertions, 16 deletions
diff --git a/InCallUI/src/com/android/incallui/CallList.java b/InCallUI/src/com/android/incallui/CallList.java
index b93744047..71387fe48 100644
--- a/InCallUI/src/com/android/incallui/CallList.java
+++ b/InCallUI/src/com/android/incallui/CallList.java
@@ -102,25 +102,28 @@ public class CallList {
}
};
handler.postDelayed(runnable, BLOCK_QUERY_TIMEOUT_MS);
- try {
- mFilteredQueryHandler.isBlocked(
- new FilteredNumberAsyncQueryHandler.OnCheckBlockedListener() {
- @Override
- public void onCheckComplete(final Integer id) {
+ if (mFilteredQueryHandler.startBlockedQuery(
+ new FilteredNumberAsyncQueryHandler.OnCheckBlockedListener() {
+ @Override
+ public void onCheckComplete(final Integer id) {
+ if (!hasTimedOut.get()) {
+ handler.removeCallbacks(runnable);
+ }
+ if (id == null) {
if (!hasTimedOut.get()) {
- handler.removeCallbacks(runnable);
- }
- if (id == null) {
- if (!hasTimedOut.get()) {
- onCallAddedInternal(call);
- }
- } else {
- call.blockCall();
+ onCallAddedInternal(call);
}
+ } else {
+ call.blockCall();
}
- }, null, call.getNumber(), countryIso);
- } catch (IllegalArgumentException e) {
- Log.d(this, "onCallAdded: invalid number, skipping block checking");
+ }
+ }, null, call.getNumber(), countryIso)) {
+ Log.d(this, "onCallAdded: invalid number "
+ + call.getNumber() + ", skipping block checking");
+ if (!hasTimedOut.get()) {
+ handler.removeCallbacks(runnable);
+ onCallAddedInternal(call);
+ }
}
} else {
onCallAddedInternal(call);