diff options
7 files changed, 95 insertions, 15 deletions
diff --git a/java/com/android/contacts/common/list/ContactListItemView.java b/java/com/android/contacts/common/list/ContactListItemView.java index 91abe4c4f..c605f4e87 100644 --- a/java/com/android/contacts/common/list/ContactListItemView.java +++ b/java/com/android/contacts/common/list/ContactListItemView.java @@ -55,6 +55,7 @@ import com.android.contacts.common.format.TextHighlighter; import com.android.contacts.common.list.PhoneNumberListAdapter.Listener; import com.android.contacts.common.util.ContactDisplayUtils; import com.android.contacts.common.util.SearchUtil; +import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.util.ViewUtil; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -341,6 +342,7 @@ public class ContactListItemView extends ViewGroup implements SelectionBoundsAdj description = R.string.description_search_video_call; onClickListener = v -> listener.onVideoCallIconClicked(position); } else if (action == LIGHTBRINGER) { + CallIntentBuilder.increaseLightbringerCallButtonAppearInSearchCount(); drawable = ContextCompat.getDrawable(getContext(), R.drawable.quantum_ic_videocam_vd_theme_24); drawable.setAutoMirrored(true); 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( 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; + } } diff --git a/java/com/android/dialer/callintent/call_specific_app_data.proto b/java/com/android/dialer/callintent/call_specific_app_data.proto index 5d23794d5..82547fa03 100644 --- a/java/com/android/dialer/callintent/call_specific_app_data.proto +++ b/java/com/android/dialer/callintent/call_specific_app_data.proto @@ -14,7 +14,7 @@ import "java/com/android/dialer/logging/ui_action.proto"; // Miscellaneous data that's included in a new outgoing call initiated by // Dialer. The system will pass this data to the InCallUi which can use it // for logging or for something else. -// Next tag: 11 +// Next tag: 14 message CallSpecificAppData { optional CallInitiationType.Type call_initiation_type = 1; @@ -34,4 +34,11 @@ message CallSpecificAppData { repeated int64 ui_action_timestamps_since_app_launch = 9; optional int32 starting_tab_index = 10; + + // For recording the appearance of video call button + optional int32 lightbringer_button_appear_in_expanded_call_log_item_count = + 11; + optional int32 lightbringer_button_appear_in_collapsed_call_log_item_count = + 12; + optional int32 lightbringer_button_appear_in_search_count = 13; } diff --git a/java/com/android/dialer/logging/dialer_impression.proto b/java/com/android/dialer/logging/dialer_impression.proto index 19beca35c..8ccaf2dea 100644 --- a/java/com/android/dialer/logging/dialer_impression.proto +++ b/java/com/android/dialer/logging/dialer_impression.proto @@ -475,5 +475,8 @@ message DialerImpression { VVM_TRANSCRIPTION_RESPONSE_INVALID = 1233; VVM_TRANSCRIPTION_RESPONSE_RECOVERABLE_ERROR = 1234; VVM_TRANSCRIPTION_RESPONSE_FATAL_ERROR = 1235; + + // In in call UI + UPGRADE_TO_VIDEO_CALL_BUTTON_SHOWN = 1236; } } diff --git a/java/com/android/incallui/incall/impl/InCallFragment.java b/java/com/android/incallui/incall/impl/InCallFragment.java index e102ee009..54d01e716 100644 --- a/java/com/android/incallui/incall/impl/InCallFragment.java +++ b/java/com/android/incallui/incall/impl/InCallFragment.java @@ -41,6 +41,8 @@ import android.widget.Toast; import com.android.dialer.common.Assert; import com.android.dialer.common.FragmentUtils; import com.android.dialer.common.LogUtil; +import com.android.dialer.logging.DialerImpression; +import com.android.dialer.logging.Logger; import com.android.dialer.multimedia.MultimediaData; import com.android.dialer.widget.LockableViewPager; import com.android.incallui.audioroute.AudioRouteSelectorDialogFragment; @@ -385,6 +387,10 @@ public class InCallFragment extends Fragment show); if (isSupportedButton(buttonId)) { getButtonController(buttonId).setAllowed(show); + if (buttonId == InCallButtonIds.BUTTON_UPGRADE_TO_VIDEO && show) { + Logger.get(getContext()) + .logImpression(DialerImpression.Type.UPGRADE_TO_VIDEO_CALL_BUTTON_SHOWN); + } } } |