diff options
author | Qi Wang <wangqi@google.com> | 2016-03-24 17:02:27 -0700 |
---|---|---|
committer | Qi Wang <wangqi@google.com> | 2016-03-28 12:53:45 -0700 |
commit | bf5cb80991de5725a5c35a11016c1508eaec3cb4 (patch) | |
tree | 2bf9799048c18c2b25ac51472c1425cc1fcb2b30 /InCallUI/src/com/android/incallui/CallList.java | |
parent | 5287c15f684011e1adacd1b63da87c5404a0d7f2 (diff) |
Add spam indicator for notification and incoming call of incallui.
+ Add spam icon and label in notification of incoming call.
+ Add spam icon and label in primary call info of incall screen.
+ Change background color and status bar color if primary caller is spam.
Screenshots:
https://screenshot.googleplex.com/WFob2oPdXZd
https://screenshot.googleplex.com/ddCfg91Anef
Bug: 27611253
Change-Id: I03b3754f69631f5f6b07932b1a0006407b93c6e8
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallList.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallList.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallList.java b/InCallUI/src/com/android/incallui/CallList.java index d0f3c1000..a3a9d743e 100644 --- a/InCallUI/src/com/android/incallui/CallList.java +++ b/InCallUI/src/com/android/incallui/CallList.java @@ -23,8 +23,8 @@ import android.telecom.DisconnectCause; import android.telecom.PhoneAccount; import com.android.contacts.common.testing.NeededForTesting; -import com.android.dialer.database.FilteredNumberAsyncQueryHandler; import com.android.dialer.logging.Logger; +import com.android.dialer.service.ExtendedCallInfoService; import com.android.incallui.util.TelecomCallUtil; import com.google.common.base.Preconditions; @@ -69,7 +69,7 @@ public class CallList { .newHashMap(); private final Set<Call> mPendingDisconnectCalls = Collections.newSetFromMap( new ConcurrentHashMap<Call, Boolean>(8, 0.9f, 1)); - private FilteredNumberAsyncQueryHandler mFilteredQueryHandler; + private ExtendedCallInfoService mExtendedCallInfoService; /** * Static singleton accessor method. @@ -94,6 +94,17 @@ public class CallList { if (call.getState() == Call.State.INCOMING || call.getState() == Call.State.CALL_WAITING) { onIncoming(call, call.getCannedSmsResponses()); + if (mExtendedCallInfoService != null) { + String number = TelecomCallUtil.getNumber(telecomCall); + mExtendedCallInfoService.getExtendedCallInfo(number, + new ExtendedCallInfoService.Listener() { + @Override + public void onComplete(boolean isSpam) { + call.setSpam(isSpam); + onUpdate(call); + } + }); + } } else { onUpdate(call); } @@ -615,8 +626,8 @@ public class CallList { } }; - public void setFilteredNumberQueryHandler(FilteredNumberAsyncQueryHandler handler) { - mFilteredQueryHandler = handler; + public void setExtendedCallInfoService(ExtendedCallInfoService service) { + mExtendedCallInfoService = service; } /** |