summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorweijiaxu <weijiaxu@google.com>2017-09-25 11:22:09 -0700
committerEric Erfanian <erfanian@google.com>2017-09-26 08:34:16 -0700
commita8d660986f87fbfdcd7310fbc7ec0b20c3b56b10 (patch)
tree800eff2216620580e540e9136f25d54e96449ed5 /java
parent38424bff03c90b93837c8c9e25a4a6041071e1e4 (diff)
Upgrade and refactor latency test over Dialer. Now it has Incall UI latency besides app launch latency. Alert functionality is not included in this cl.
Add a new idlingResource for incall ui and a new method called waitForInCallUiShown in DialerCallEspresso. Add UiListener interface in CallList and insert uilisteners on onCallAdded() and onInCallUiShown(). Also, a g3doc page has been created in http://cl/168901452 to show the dashboards. Test: Run on a local device PiperOrigin-RevId: 169934618 Change-Id: I0ea10aca051c62cd8252ee5a3c9dfbce81316a33
Diffstat (limited to 'java')
-rw-r--r--java/com/android/incallui/call/CallList.java22
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;