diff options
author | uabdullah <uabdullah@google.com> | 2017-09-19 13:07:33 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-09-19 15:08:58 -0700 |
commit | 01e9204670bd6b8b2c4a1e64abf1d01c8077024f (patch) | |
tree | e97ebcc4b2d61bf4cdce92757354ec73447f19bc /java | |
parent | 15c5ccfc3a76c89b047722b398e63889d900ec5e (diff) |
Refactor second call logging
Just easier readability since getFirstCall() is null until it's added to the call map.
Test: N/A
PiperOrigin-RevId: 169287247
Change-Id: Ifda5ead27d987e17f259da761a0109d930efa6c3
Diffstat (limited to 'java')
-rw-r--r-- | java/com/android/incallui/call/CallList.java | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/java/com/android/incallui/call/CallList.java b/java/com/android/incallui/call/CallList.java index 954fdc910..c4b29d918 100644 --- a/java/com/android/incallui/call/CallList.java +++ b/java/com/android/incallui/call/CallList.java @@ -118,7 +118,9 @@ public class CallList implements DialerCallDelegate { Trace.beginSection("CallList.onCallAdded"); final DialerCall call = new DialerCall(context, this, telecomCall, latencyReport, true /* registerCallback */); - logSecondIncomingCall(context, call); + if (getFirstCall() != null) { + logSecondIncomingCall(context, getFirstCall(), call); + } EnrichedCallManager manager = EnrichedCallComponent.get(context).getEnrichedCallManager(); manager.registerCapabilitiesListener(call); @@ -206,28 +208,26 @@ public class CallList implements DialerCallDelegate { Trace.endSection(); } - private void logSecondIncomingCall(@NonNull Context context, @NonNull DialerCall incomingCall) { - DialerCall firstCall = getFirstCall(); - if (firstCall != null) { - DialerImpression.Type impression; - if (firstCall.isVideoCall()) { - if (incomingCall.isVideoCall()) { - impression = DialerImpression.Type.VIDEO_CALL_WITH_INCOMING_VIDEO_CALL; - } else { - impression = DialerImpression.Type.VIDEO_CALL_WITH_INCOMING_VOICE_CALL; - } + private void logSecondIncomingCall( + @NonNull Context context, @NonNull DialerCall firstCall, @NonNull DialerCall incomingCall) { + DialerImpression.Type impression; + if (firstCall.isVideoCall()) { + if (incomingCall.isVideoCall()) { + impression = DialerImpression.Type.VIDEO_CALL_WITH_INCOMING_VIDEO_CALL; } else { - if (incomingCall.isVideoCall()) { - impression = DialerImpression.Type.VOICE_CALL_WITH_INCOMING_VIDEO_CALL; - } else { - impression = DialerImpression.Type.VOICE_CALL_WITH_INCOMING_VOICE_CALL; - } + impression = DialerImpression.Type.VIDEO_CALL_WITH_INCOMING_VOICE_CALL; + } + } else { + if (incomingCall.isVideoCall()) { + impression = DialerImpression.Type.VOICE_CALL_WITH_INCOMING_VIDEO_CALL; + } else { + impression = DialerImpression.Type.VOICE_CALL_WITH_INCOMING_VOICE_CALL; } - Assert.checkArgument(impression != null); - Logger.get(context) - .logCallImpression( - impression, incomingCall.getUniqueCallId(), incomingCall.getTimeAddedMs()); } + Assert.checkArgument(impression != null); + Logger.get(context) + .logCallImpression( + impression, incomingCall.getUniqueCallId(), incomingCall.getTimeAddedMs()); } private static boolean isPotentialEmergencyCallback(Context context, DialerCall call) { |