summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroldenburg <roldenburg@google.com>2018-03-29 02:04:55 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-03-29 02:04:55 +0000
commit4a0882210dd6e3eb986172e9c7640c2353bff951 (patch)
tree23c2dc5189d19171c1ab00fce5aa998040860b28
parent685542ddcd32783a598a13c83d688beb8b237a73 (diff)
parentbd198df6107e86d92c7d71792abca5c2437056e2 (diff)
Merge "Show toast when handing off from LTE to WiFi" am: e7d6381c9c
am: bd198df610 Change-Id: I61e9cb5211a341966255cac6b13cd26a17f618d7
-rw-r--r--java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java2
-rw-r--r--java/com/android/dialer/theme/res/values/strings.xml3
-rw-r--r--java/com/android/incallui/call/DialerCall.java16
3 files changed, 21 insertions, 0 deletions
diff --git a/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java b/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java
index 655540bba..41e5be29f 100644
--- a/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java
+++ b/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java
@@ -35,6 +35,8 @@ public class TelephonyManagerCompat {
// TODO(maxwelb): Use public API for these constants when available
public static final String EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE =
"android.telephony.event.EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE";
+ public static final String EVENT_HANDOVER_VIDEO_FROM_LTE_TO_WIFI =
+ "android.telephony.event.EVENT_HANDOVER_VIDEO_FROM_LTE_TO_WIFI";
public static final String EVENT_HANDOVER_TO_WIFI_FAILED =
"android.telephony.event.EVENT_HANDOVER_TO_WIFI_FAILED";
public static final String EVENT_CALL_REMOTELY_HELD = "android.telecom.event.CALL_REMOTELY_HELD";
diff --git a/java/com/android/dialer/theme/res/values/strings.xml b/java/com/android/dialer/theme/res/values/strings.xml
index bab05ed41..36ff9413a 100644
--- a/java/com/android/dialer/theme/res/values/strings.xml
+++ b/java/com/android/dialer/theme/res/values/strings.xml
@@ -36,6 +36,9 @@
<!-- Label shown on the 'positive' button for the dialog. Indicates that the call will proceed -->
<string name="call">Call</string>
+ <!-- Displayed when handover from WiFi to Lte occurs during a video call -->
+ <string name="video_call_lte_to_wifi_handover_toast">Continuing call using Wi\u2011Fi\u2026</string>
+
<!-- String used to build a phone number type and phone number string.
Example: Mobile 650-555-1212 -->
<string name="call_subject_type_and_number">
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java
index 9a7c6530f..4815a6e41 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -47,6 +47,7 @@ import android.telecom.StatusHints;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
import android.text.TextUtils;
+import android.widget.Toast;
import com.android.contacts.common.compat.CallCompat;
import com.android.contacts.common.compat.telecom.TelecomManagerCompat;
import com.android.dialer.assisteddialing.ConcreteCreator;
@@ -142,6 +143,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
private int state = State.INVALID;
private DisconnectCause disconnectCause;
+ private boolean hasShownLteToWiFiHandoverToast;
private boolean hasShownWiFiToLteHandoverToast;
private boolean doNotShowDialogForHandoffToWifiFailure;
@@ -309,6 +311,9 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
case TelephonyManagerCompat.EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE:
notifyWiFiToLteHandover();
break;
+ case TelephonyManagerCompat.EVENT_HANDOVER_VIDEO_FROM_LTE_TO_WIFI:
+ onLteToWifiHandover();
+ break;
case TelephonyManagerCompat.EVENT_HANDOVER_TO_WIFI_FAILED:
notifyHandoverToWifiFailed();
break;
@@ -448,6 +453,17 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
cannedTextResponsesLoadedListeners.remove(listener);
}
+ private void onLteToWifiHandover() {
+ LogUtil.enterBlock("DialerCall.onLteToWifiHandover");
+ if (hasShownLteToWiFiHandoverToast) {
+ return;
+ }
+
+ Toast.makeText(context, R.string.video_call_lte_to_wifi_handover_toast, Toast.LENGTH_LONG)
+ .show();
+ hasShownLteToWiFiHandoverToast = true;
+ }
+
public void notifyWiFiToLteHandover() {
LogUtil.i("DialerCall.notifyWiFiToLteHandover", "");
for (DialerCallListener listener : listeners) {