diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/com/android/incallui/call/CallList.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/java/com/android/incallui/call/CallList.java b/java/com/android/incallui/call/CallList.java index 1f2c4c6ec..8d6620628 100644 --- a/java/com/android/incallui/call/CallList.java +++ b/java/com/android/incallui/call/CallList.java @@ -79,6 +79,8 @@ public class CallList implements DialerCallDelegate { private final Set<DialerCall> mPendingDisconnectCalls = Collections.newSetFromMap(new ConcurrentHashMap<DialerCall, Boolean>(8, 0.9f, 1)); + + private UiListener mUiListeners; /** Handles the timeout for destroying disconnected calls. */ private final Handler mHandler = new Handler() { @@ -116,6 +118,9 @@ public class CallList implements DialerCallDelegate { public void onCallAdded( final Context context, final android.telecom.Call telecomCall, LatencyReport latencyReport) { Trace.beginSection("CallList.onCallAdded"); + if (mUiListeners != null) { + mUiListeners.onCallAdded(); + } final DialerCall call = new DialerCall(context, this, telecomCall, latencyReport, true /* registerCallback */); if (getFirstCall() != null) { @@ -377,6 +382,10 @@ public class CallList implements DialerCallDelegate { listener.onCallListChange(this); } + public void setUiListener(UiListener uiListener) { + mUiListeners = uiListener; + } + public void removeListener(@Nullable Listener listener) { if (listener != null) { mListeners.remove(listener); @@ -727,6 +736,9 @@ public class CallList implements DialerCallDelegate { for (DialerCall call : mCallById.values()) { call.getLatencyReport().onInCallUiShown(forFullScreenIntent); } + if (mUiListeners != null) { + mUiListeners.onInCallUiShown(); + } } /** Listener interface for any class that wants to be notified of changes to the call list. */ @@ -775,6 +787,16 @@ public class CallList implements DialerCallDelegate { void onInternationalCallOnWifi(@NonNull DialerCall call); } + /** UiListener interface for measuring incall latency.(used by testing only) */ + public interface UiListener { + + /** Called when a new call gets added into call list from IncallServiceImpl */ + void onCallAdded(); + + /** Called in the end of onResume method of IncallActivityCommon. */ + void onInCallUiShown(); + } + private class DialerCallListenerImpl implements DialerCallListener { @NonNull private final DialerCall mCall; |