diff options
author | yueg <yueg@google.com> | 2017-06-28 10:27:26 -0700 |
---|---|---|
committer | Brandon Maxwell <maxwelb@google.com> | 2017-06-30 14:37:57 -0700 |
commit | 7f10924e13a030fa82b58d3443af56ba63ba8271 (patch) | |
tree | 96e6d065ee0acb65f8b43538dacb24fa294ecb80 /java/com/android/dialer/callintent/CallIntentBuilder.java | |
parent | f20dfb5ec4d05416bf53367db1c143e2799d3639 (diff) |
Log the number of times when Lightbringer video call button appears.
Including in:
- expanded call log item
- collapsed call log item
- search
- in call UI
LOG_STORAGE_INCREASE(GB/week): 3.15
5M active block user/day * 10 events/active = 350M event/wk
350M event/wk * (3 * 3 [int32])/event = 3.15GB/wk
Test: GoogleCallLogAdapterTest, ContactListItemViewTest, InCallFragmentTest
PiperOrigin-RevId: 160423797
Change-Id: I6c0ade53caf767ea9b2610a4c0eb68fcc2bcedf7
Diffstat (limited to 'java/com/android/dialer/callintent/CallIntentBuilder.java')
-rw-r--r-- | java/com/android/dialer/callintent/CallIntentBuilder.java | 61 |
1 files changed, 51 insertions, 10 deletions
diff --git a/java/com/android/dialer/callintent/CallIntentBuilder.java b/java/com/android/dialer/callintent/CallIntentBuilder.java index e5a0be848..e5449c804 100644 --- a/java/com/android/dialer/callintent/CallIntentBuilder.java +++ b/java/com/android/dialer/callintent/CallIntentBuilder.java @@ -22,6 +22,7 @@ import android.os.Bundle; import android.os.SystemClock; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.annotation.VisibleForTesting; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; import android.telecom.VideoProfile; @@ -38,25 +39,38 @@ public class CallIntentBuilder { private boolean isVideoCall; private String callSubject; + private static int lightbringerButtonAppearInExpandedCallLogItemCount = 0; + private static int lightbringerButtonAppearInCollapsedCallLogItemCount = 0; + private static int lightbringerButtonAppearInSearchCount = 0; + public CallIntentBuilder(@NonNull Uri uri, @NonNull CallSpecificAppData callSpecificAppData) { this.uri = Assert.isNotNull(uri); Assert.isNotNull(callSpecificAppData); Assert.checkArgument( callSpecificAppData.getCallInitiationType() != CallInitiationType.Type.UNKNOWN_INITIATION); + CallSpecificAppData.Builder builder = + CallSpecificAppData.newBuilder(callSpecificAppData) + .setLightbringerButtonAppearInExpandedCallLogItemCount( + lightbringerButtonAppearInExpandedCallLogItemCount) + .setLightbringerButtonAppearInCollapsedCallLogItemCount( + lightbringerButtonAppearInCollapsedCallLogItemCount) + .setLightbringerButtonAppearInSearchCount(lightbringerButtonAppearInSearchCount); + lightbringerButtonAppearInExpandedCallLogItemCount = 0; + lightbringerButtonAppearInCollapsedCallLogItemCount = 0; + lightbringerButtonAppearInSearchCount = 0; + if (PerformanceReport.isRecording()) { - this.callSpecificAppData = - CallSpecificAppData.newBuilder(callSpecificAppData) - .setTimeSinceAppLaunch(PerformanceReport.getTimeSinceAppLaunch()) - .setTimeSinceFirstClick(PerformanceReport.getTimeSinceFirstClick()) - .addAllUiActionsSinceAppLaunch(PerformanceReport.getActions()) - .addAllUiActionTimestampsSinceAppLaunch(PerformanceReport.getActionTimestamps()) - .setStartingTabIndex(PerformanceReport.getStartingTabIndex()) - .build(); + builder + .setTimeSinceAppLaunch(PerformanceReport.getTimeSinceAppLaunch()) + .setTimeSinceFirstClick(PerformanceReport.getTimeSinceFirstClick()) + .addAllUiActionsSinceAppLaunch(PerformanceReport.getActions()) + .addAllUiActionTimestampsSinceAppLaunch(PerformanceReport.getActionTimestamps()) + .build(); PerformanceReport.stopRecording(); - } else { - this.callSpecificAppData = callSpecificAppData; } + + this.callSpecificAppData = builder.build(); } public CallIntentBuilder(@NonNull Uri uri, CallInitiationType.Type callInitiationType) { @@ -119,4 +133,31 @@ public class CallIntentBuilder { CallSpecificAppData.newBuilder().setCallInitiationType(callInitiationType).build(); return callSpecificAppData; } + + public static void increaseLightbringerCallButtonAppearInExpandedCallLogItemCount() { + CallIntentBuilder.lightbringerButtonAppearInExpandedCallLogItemCount++; + } + + public static void increaseLightbringerCallButtonAppearInCollapsedCallLogItemCount() { + CallIntentBuilder.lightbringerButtonAppearInCollapsedCallLogItemCount++; + } + + public static void increaseLightbringerCallButtonAppearInSearchCount() { + CallIntentBuilder.lightbringerButtonAppearInSearchCount++; + } + + @VisibleForTesting + public static int getLightbringerButtonAppearInExpandedCallLogItemCount() { + return lightbringerButtonAppearInExpandedCallLogItemCount; + } + + @VisibleForTesting + public static int getLightbringerButtonAppearInCollapsedCallLogItemCount() { + return lightbringerButtonAppearInCollapsedCallLogItemCount; + } + + @VisibleForTesting + public static int getLightbringerButtonAppearInSearchCount() { + return lightbringerButtonAppearInSearchCount; + } } |