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/app/calllog | |
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/app/calllog')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogAdapter.java | 17 | ||||
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 12 |
2 files changed, 25 insertions, 4 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index 216cae4a3..d7a27dfca 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -64,6 +64,7 @@ import com.android.dialer.app.voicemail.VoicemailPlaybackPresenter.OnVoicemailDe import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler; import com.android.dialer.calldetails.CallDetailsEntries; import com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry; +import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.calllogutils.PhoneAccountUtils; import com.android.dialer.calllogutils.PhoneCallDetails; import com.android.dialer.common.Assert; @@ -294,6 +295,11 @@ public class CallLogAdapter extends GroupingListAdapter } }; + @VisibleForTesting + public View.OnClickListener getExpandCollapseListener() { + return mExpandCollapseListener; + } + /** The OnClickListener used to expand or collapse the action buttons of a call log entry. */ private final View.OnClickListener mExpandCollapseListener = new View.OnClickListener() { @@ -362,6 +368,17 @@ public class CallLogAdapter extends GroupingListAdapter } } expandViewHolderActions(viewHolder); + + if (viewHolder.videoCallButtonView.getVisibility() == View.VISIBLE + && LightbringerComponent.get(mActivity) + .getLightbringer() + .getPackageName() + .equals( + ((IntentProvider) viewHolder.videoCallButtonView.getTag()) + .getIntent(mActivity) + .getPackage())) { + CallIntentBuilder.increaseLightbringerCallButtonAppearInExpandedCallLogItemCount(); + } } } }; diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index aaa56d453..2e61848d2 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -69,6 +69,7 @@ import com.android.dialer.blocking.FilteredNumbersUtil; import com.android.dialer.callcomposer.CallComposerActivity; import com.android.dialer.calldetails.CallDetailsActivity; import com.android.dialer.calldetails.CallDetailsEntries; +import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.compat.CompatUtils; @@ -345,11 +346,13 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } public static CallLogListItemViewHolder createForTest(Context context) { - return createForTest(context, null); + return createForTest(context, null, null); } - static CallLogListItemViewHolder createForTest( - Context context, VoicemailPlaybackPresenter voicemailPlaybackPresenter) { + public static CallLogListItemViewHolder createForTest( + Context context, + View.OnClickListener expandCollapseListener, + VoicemailPlaybackPresenter voicemailPlaybackPresenter) { Resources resources = context.getResources(); CallLogCache callLogCache = CallLogCache.getCallLogCache(context); PhoneCallDetailsHelper phoneCallDetailsHelper = @@ -359,7 +362,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder new CallLogListItemViewHolder( context, null, - null /* expandCollapseListener */, + expandCollapseListener /* expandCollapseListener */, null, null, callLogCache, @@ -512,6 +515,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder boolean isVoicemailNumber = mCallLogCache.isVoicemailNumber(accountHandle, number); if (!isVoicemailNumber && showLightbringerPrimaryButton()) { + CallIntentBuilder.increaseLightbringerCallButtonAppearInCollapsedCallLogItemCount(); primaryActionButtonView.setTag(IntentProvider.getLightbringerIntentProvider(number)); primaryActionButtonView.setContentDescription( TextUtils.expandTemplate( |