Show a warning dialog about charges when user starts a video call
The user starts a video call a warning dialog shall be presented.
If the user presses "OK" with the "Do not show again" box selected,
the dialog shall not be presented anymore.
Test: manual - Verified that a warning dialog about charges is shown
when a video call is started if
KEY_SHOW_VIDEO_CALL_CHARGES_ALERT_DIALOG_BOOL is true.
This is an upstream change from:
https://android-review.googlesource.com/c/platform/packages/apps/Dialer/+/518977/8
Bug: 67832837
Test: partner manual test
PiperOrigin-RevId: 188103414
Change-Id: I62628a32557297acaef096db90d2ddf049ef5017
diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java
index a19d45f..f5d681c 100644
--- a/java/com/android/incallui/VideoCallPresenter.java
+++ b/java/com/android/incallui/VideoCallPresenter.java
@@ -20,6 +20,7 @@
import android.content.Context;
import android.graphics.Point;
import android.os.Handler;
+import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.telecom.InCallService.VideoCall;
import android.telecom.VideoProfile;
@@ -80,7 +81,8 @@
InCallDetailsListener,
SurfaceChangeListener,
InCallPresenter.InCallEventListener,
- VideoCallScreenDelegate {
+ VideoCallScreenDelegate,
+ CallList.Listener {
private static boolean isVideoMode = false;
@@ -325,6 +327,8 @@
InCallPresenter.getInstance().getLocalVideoSurfaceTexture().setDelegate(new LocalDelegate());
InCallPresenter.getInstance().getRemoteVideoSurfaceTexture().setDelegate(new RemoteDelegate());
+ CallList.getInstance().addListener(this);
+
// Register for surface and video events from {@link InCallVideoCallListener}s.
InCallVideoCallCallbackNotifier.getInstance().addSurfaceChangeListener(this);
currentVideoState = VideoProfile.STATE_AUDIO_ONLY;
@@ -354,6 +358,8 @@
InCallPresenter.getInstance().removeInCallEventListener(this);
InCallPresenter.getInstance().getLocalVideoSurfaceTexture().setDelegate(null);
+ CallList.getInstance().removeListener(this);
+
InCallVideoCallCallbackNotifier.getInstance().removeSurfaceChangeListener(this);
// Ensure that the call's camera direction is updated (most likely to UNKNOWN). Normally this
@@ -1126,6 +1132,34 @@
|| VideoUtils.hasReceivedVideoUpgradeRequest(state);
}
+ @Override
+ public void onIncomingCall(DialerCall call) {}
+
+ @Override
+ public void onUpgradeToVideo(DialerCall call) {}
+
+ @Override
+ public void onSessionModificationStateChange(DialerCall call) {}
+
+ @Override
+ public void onCallListChange(CallList callList) {}
+
+ @Override
+ public void onDisconnect(DialerCall call) {}
+
+ @Override
+ public void onWiFiToLteHandover(DialerCall call) {
+ if (call.isVideoCall() || call.hasSentVideoUpgradeRequest()) {
+ videoCallScreen.onHandoverFromWiFiToLte();
+ }
+ }
+
+ @Override
+ public void onHandoverToWifiFailed(DialerCall call) {}
+
+ @Override
+ public void onInternationalCallOnWifi(@NonNull DialerCall call) {}
+
private class LocalDelegate implements VideoSurfaceDelegate {
@Override
public void onSurfaceCreated(VideoSurfaceTexture videoCallSurface) {