Lazy loading animation of hd icon.
This save us ~180ms on Go device. (analyzed by systrace)
This change also adds some trace information on incallui.
Bug: 64542087
Test: manual
PiperOrigin-RevId: 167201182
Change-Id: I0e8549cfb3534d518e3990696616855bcf7733f2
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java
index 9b1f674..3f87a59 100644
--- a/java/com/android/incallui/InCallPresenter.java
+++ b/java/com/android/incallui/InCallPresenter.java
@@ -769,15 +769,19 @@
"InCallPresenter.onIncomingCall", "Phone switching state: " + oldState + " -> " + newState);
mInCallState = newState;
+ Trace.beginSection("listener.onIncomingCall");
for (IncomingCallListener listener : mIncomingCallListeners) {
listener.onIncomingCall(oldState, mInCallState, call);
}
+ Trace.endSection();
+ Trace.beginSection("onPrimaryCallStateChanged");
if (mInCallActivity != null) {
// Re-evaluate which fragment is being shown.
mInCallActivity.onPrimaryCallStateChanged();
}
Trace.endSection();
+ Trace.endSection();
}
@Override
@@ -1278,6 +1282,7 @@
* UI needs to be started or finished depending on the new state and does it.
*/
private InCallState startOrFinishUi(InCallState newState) {
+ Trace.beginSection("InCallPresenter.startOrFinishUi");
LogUtil.d(
"InCallPresenter.startOrFinishUi", "startOrFinishUi: " + mInCallState + " -> " + newState);
@@ -1286,6 +1291,7 @@
// If the state isn't changing we have already done any starting/stopping of activities in
// a previous pass...so lets cut out early
if (newState == mInCallState) {
+ Trace.endSection();
return newState;
}
@@ -1364,6 +1370,7 @@
LogUtil.i(
"InCallPresenter.startOrFinishUi",
"Undo the state change: " + newState + " -> " + mInCallState);
+ Trace.endSection();
return mInCallState;
}
@@ -1390,6 +1397,7 @@
attemptCleanup();
}
+ Trace.endSection();
return newState;
}