diff options
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallList.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallList.java | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/InCallUI/src/com/android/incallui/CallList.java b/InCallUI/src/com/android/incallui/CallList.java index d0f3c1000..48870f68a 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. @@ -86,14 +86,25 @@ public class CallList { CallList() { } - public void onCallAdded(final android.telecom.Call telecomCall) { + public void onCallAdded(final android.telecom.Call telecomCall, LatencyReport latencyReport) { Trace.beginSection("onCallAdded"); - final Call call = new Call(telecomCall); + final Call call = new Call(telecomCall, latencyReport); Log.d(this, "onCallAdded: callState=" + call.getState()); 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, null, + new ExtendedCallInfoService.Listener() { + @Override + public void onComplete(boolean isSpam) { + call.setSpam(isSpam); + onUpdate(call); + } + }); + } } else { onUpdate(call); } @@ -615,8 +626,14 @@ public class CallList { } }; - public void setFilteredNumberQueryHandler(FilteredNumberAsyncQueryHandler handler) { - mFilteredQueryHandler = handler; + public void setExtendedCallInfoService(ExtendedCallInfoService service) { + mExtendedCallInfoService = service; + } + + public void onInCallUiShown(boolean forFullScreenIntent) { + for (Call call : mCallById.values()) { + call.getLatencyReport().onInCallUiShown(forFullScreenIntent); + } } /** |