diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-16 00:09:31 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-16 00:09:31 +0000 |
commit | c57430a61eab62e88372f386c75989dab6332608 (patch) | |
tree | b606f1899f80fcd0ea3ee753ce799883d5a673ab /java/com/android/incallui/InCallActivityCommon.java | |
parent | 9842b4a7fd1d852b1353af806da4913b4298d516 (diff) | |
parent | 0c9dbf507b53a12bdf577ff3e55c1686a2e089de (diff) |
Merge "Update Dialer to v10 RC32" into oc-dev
am: 0c9dbf507b
Change-Id: I5f90090090c6e430d83fcdd294082c1f5237ade8
Diffstat (limited to 'java/com/android/incallui/InCallActivityCommon.java')
-rw-r--r-- | java/com/android/incallui/InCallActivityCommon.java | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/java/com/android/incallui/InCallActivityCommon.java b/java/com/android/incallui/InCallActivityCommon.java index e6c74b0a9..4b0a3cd05 100644 --- a/java/com/android/incallui/InCallActivityCommon.java +++ b/java/com/android/incallui/InCallActivityCommon.java @@ -62,6 +62,8 @@ import com.android.incallui.call.CallList; import com.android.incallui.call.DialerCall; import com.android.incallui.call.DialerCall.State; import com.android.incallui.call.TelecomAdapter; +import com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment; +import com.android.incallui.telecomeventui.InternationalCallOnWifiDialogFragment.Callback; import com.android.incallui.wifi.EnableWifiCallingPrompt; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -80,6 +82,7 @@ public class InCallActivityCommon { private static final String TAG_SELECT_ACCOUNT_FRAGMENT = "tag_select_account_fragment"; private static final String TAG_DIALPAD_FRAGMENT = "tag_dialpad_fragment"; + private static final String TAG_INTERNATIONAL_CALL_ON_WIFI = "tag_international_call_on_wifi"; @Retention(RetentionPolicy.SOURCE) @IntDef({ @@ -107,7 +110,7 @@ public class InCallActivityCommon { private String dtmfTextToPreopulate; @DialpadRequestType private int showDialpadRequest = DIALPAD_REQUEST_NONE; - private SelectPhoneAccountListener selectAccountListener = + private final SelectPhoneAccountListener selectAccountListener = new SelectPhoneAccountListener() { @Override public void onPhoneAccountSelected( @@ -133,6 +136,25 @@ public class InCallActivityCommon { } }; + private InternationalCallOnWifiDialogFragment.Callback internationalCallOnWifiCallback = + new Callback() { + @Override + public void continueCall(@NonNull String callId) { + LogUtil.i("InCallActivityCommon.continueCall", "continuing call with id: %s", callId); + } + + @Override + public void cancelCall(@NonNull String callId) { + DialerCall call = CallList.getInstance().getCallById(callId); + if (call == null) { + LogUtil.i("InCallActivityCommon.cancelCall", "call destroyed before dialog closed"); + return; + } + LogUtil.i("InCallActivityCommon.cancelCall", "disconnecting international call on wifi"); + call.disconnect(); + } + }; + public static void setIntentExtras( Intent intent, boolean showDialpad, boolean newOutgoingCall, boolean isForFullScreen) { if (showDialpad) { @@ -210,6 +232,17 @@ public class InCallActivityCommon { } } + InternationalCallOnWifiDialogFragment existingInternationalFragment = + (InternationalCallOnWifiDialogFragment) + inCallActivity + .getSupportFragmentManager() + .findFragmentByTag(TAG_INTERNATIONAL_CALL_ON_WIFI); + if (existingInternationalFragment != null) { + LogUtil.i( + "InCallActivityCommon.onCreate", "international fragment exists attaching callback"); + existingInternationalFragment.setCallback(internationalCallOnWifiCallback); + } + inCallOrientationEventListener = new InCallOrientationEventListener(inCallActivity); } @@ -510,6 +543,18 @@ public class InCallActivityCommon { selectPhoneAccountDialogFragment.dismiss(); selectPhoneAccountDialogFragment = null; } + + InternationalCallOnWifiDialogFragment internationalCallOnWifiFragment = + (InternationalCallOnWifiDialogFragment) + inCallActivity + .getSupportFragmentManager() + .findFragmentByTag(TAG_INTERNATIONAL_CALL_ON_WIFI); + if (internationalCallOnWifiFragment != null) { + LogUtil.i( + "InCallActivityCommon.dismissPendingDialogs", + "dismissing InternationalCallOnWifiDialogFragment"); + internationalCallOnWifiFragment.dismiss(); + } } private static boolean shouldShowDisconnectErrorDialog(@NonNull DisconnectCause cause) { @@ -584,6 +629,21 @@ public class InCallActivityCommon { } } + void showInternationalCallOnWifiDialog(@NonNull DialerCall call) { + LogUtil.enterBlock("InCallActivityCommon.showInternationalCallOnWifiDialog"); + if (!InternationalCallOnWifiDialogFragment.shouldShow(inCallActivity)) { + LogUtil.i( + "InCallActivityCommon.showInternationalCallOnWifiDialog", + "InternationalCallOnWifiDialogFragment.shouldShow returned false"); + return; + } + + InternationalCallOnWifiDialogFragment fragment = + InternationalCallOnWifiDialogFragment.newInstance( + call.getId(), internationalCallOnWifiCallback); + fragment.show(inCallActivity.getSupportFragmentManager(), TAG_INTERNATIONAL_CALL_ON_WIFI); + } + public void showWifiToLteHandoverToast(DialerCall call) { if (call.hasShownWiFiToLteHandoverToast()) { return; |