diff options
author | yueg <yueg@google.com> | 2017-08-10 13:58:04 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-11 11:45:51 -0700 |
commit | a30dd0f49b2bf63d292c90821c374be34755aeca (patch) | |
tree | b7e4d1a78cb8663a2c96da0975479204469bb592 | |
parent | 5accf42964ab15d92db5b7389f04ef3c282aae0e (diff) |
Add video call logging.
Including:
- Upgrade to video call button shown for Lightbringer, IMS, RCS
- Lightbringer upgrade requested
- Has Lightbringer reachable contact when launching Dialer
Test: RcsVideoShareTest, ImsVideoTechTest, LightbringerTechTest
PiperOrigin-RevId: 164899006
Change-Id: I1e5d4aacfb558d4b610842795771cb97c53d2f40
6 files changed, 41 insertions, 0 deletions
diff --git a/java/com/android/dialer/logging/dialer_impression.proto b/java/com/android/dialer/logging/dialer_impression.proto index 69be3e1f0..4422b9ce7 100644 --- a/java/com/android/dialer/logging/dialer_impression.proto +++ b/java/com/android/dialer/logging/dialer_impression.proto @@ -490,5 +490,14 @@ message DialerImpression { BACKUP_KEY_VALUE_ON_RESTORE_FINISHED = 1241; BACKUP_KEY_VALUE_GET_BACKUP_SPECIFICATION = 1242; BACKUP_KEY_VALUE_BACKUP_AGENT_CONSTRUCTOR = 1243; + + // In the in call UI + UPGRADE_TO_VIDEO_CALL_BUTTON_SHOWN_FOR_LIGHTBRINGER = 1244; + UPGRADE_TO_VIDEO_CALL_BUTTON_SHOWN_FOR_IMS = 1245; + UPGRADE_TO_VIDEO_CALL_BUTTON_SHOWN_FOR_RCS = 1246; + LIGHTBRINGER_UPGRADE_REQUESTED = 1247; + + // Found Lightbringer reachable contact when launching Dialer + HAS_LIGHTBRINGER_REACHABLE_CONTACTS = 1248; } } diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 4d8068846..a954ee914 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -1273,6 +1273,11 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa updateEnrichedCallSession(); } + @Override + public void onImpressionLoggingNeeded(DialerImpression.Type impressionType) { + Logger.get(mContext).logCallImpression(impressionType, getUniqueCallId(), getTimeAddedMs()); + } + private void updateEnrichedCallSession() { if (getNumber() == null) { return; @@ -1554,6 +1559,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa if (tech.isAvailable(context)) { // Remember the first VideoTech that becomes available and always use it savedTech = tech; + savedTech.becomePrimary(); return savedTech; } } diff --git a/java/com/android/incallui/videotech/VideoTech.java b/java/com/android/incallui/videotech/VideoTech.java index 34c3e2ca9..79a8c605c 100644 --- a/java/com/android/incallui/videotech/VideoTech.java +++ b/java/com/android/incallui/videotech/VideoTech.java @@ -18,6 +18,7 @@ package com.android.incallui.videotech; import android.content.Context; import android.support.annotation.Nullable; +import com.android.dialer.logging.DialerImpression; import com.android.incallui.video.protocol.VideoCallScreen; import com.android.incallui.video.protocol.VideoCallScreenDelegate; import com.android.incallui.videotech.utils.SessionModificationState; @@ -69,6 +70,12 @@ public interface VideoTech { void setDeviceOrientation(int rotation); + /** + * Called on {@code VideoTechManager.savedTech} when it's first selected and it will always be + * used. + */ + void becomePrimary(); + /** Listener for video call events. */ interface VideoTechListener { @@ -83,5 +90,7 @@ public interface VideoTech { void onVideoUpgradeRequestReceived(); void onUpgradedToVideo(boolean switchToSpeaker); + + void onImpressionLoggingNeeded(DialerImpression.Type impressionType); } } diff --git a/java/com/android/incallui/videotech/empty/EmptyVideoTech.java b/java/com/android/incallui/videotech/empty/EmptyVideoTech.java index 85eb64ee4..34dd1bf8b 100644 --- a/java/com/android/incallui/videotech/empty/EmptyVideoTech.java +++ b/java/com/android/incallui/videotech/empty/EmptyVideoTech.java @@ -98,4 +98,7 @@ public class EmptyVideoTech implements VideoTech { @Override public void setDeviceOrientation(int rotation) {} + + @Override + public void becomePrimary() {} } diff --git a/java/com/android/incallui/videotech/ims/ImsVideoTech.java b/java/com/android/incallui/videotech/ims/ImsVideoTech.java index 641d436d4..fec05dc55 100644 --- a/java/com/android/incallui/videotech/ims/ImsVideoTech.java +++ b/java/com/android/incallui/videotech/ims/ImsVideoTech.java @@ -315,6 +315,12 @@ public class ImsVideoTech implements VideoTech { call.getVideoCall().setDeviceOrientation(rotation); } + @Override + public void becomePrimary() { + listener.onImpressionLoggingNeeded( + DialerImpression.Type.UPGRADE_TO_VIDEO_CALL_BUTTON_SHOWN_FOR_IMS); + } + private boolean canPause() { return call.getDetails().can(Details.CAPABILITY_CAN_PAUSE_VIDEO); } diff --git a/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java b/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java index 961de9e9a..26d634765 100644 --- a/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java +++ b/java/com/android/incallui/videotech/lightbringer/LightbringerTech.java @@ -26,6 +26,7 @@ import com.android.dialer.common.Assert; import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.lightbringer.Lightbringer; import com.android.dialer.lightbringer.LightbringerListener; +import com.android.dialer.logging.DialerImpression; import com.android.incallui.video.protocol.VideoCallScreen; import com.android.incallui.video.protocol.VideoCallScreenDelegate; import com.android.incallui.videotech.VideoTech; @@ -102,6 +103,7 @@ public class LightbringerTech implements VideoTech, LightbringerListener { @Override public void upgradeToVideo() { + listener.onImpressionLoggingNeeded(DialerImpression.Type.LIGHTBRINGER_UPGRADE_REQUESTED); lightbringer.requestUpgrade(call); } @@ -147,6 +149,12 @@ public class LightbringerTech implements VideoTech, LightbringerListener { } @Override + public void becomePrimary() { + listener.onImpressionLoggingNeeded( + DialerImpression.Type.UPGRADE_TO_VIDEO_CALL_BUTTON_SHOWN_FOR_LIGHTBRINGER); + } + + @Override public void setDeviceOrientation(int rotation) { throw Assert.createUnsupportedOperationFailException(); } |