diff options
| author | 2018-09-20 23:31:04 -0700 | |
|---|---|---|
| committer | 2018-09-20 23:31:04 -0700 | |
| commit | 7286d12eeb44c7813553fc8025a53e9c13776cc5 (patch) | |
| tree | 4b371b0e1307d4efa2b23b8dbc052c00caac4848 | |
| parent | f2d05ccd20c31aec821d8e5347be937a07c50046 (diff) | |
| parent | 8a456bad23d1ab6f6480fa4a73c56be5ed07c20a (diff) | |
Merge "Propagates voice call radio technology to connection" am: 5405d09204
am: 8a456bad23
Change-Id: I1f00192c5019b30b68c25d31cf40f3edec53416c
| -rwxr-xr-x | api/current.txt | 1 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/Conference.java | 47 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/Connection.java | 40 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/TelecomManager.java | 9 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/ImsCallProfile.java | 3 |
5 files changed, 99 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index bf123f84c276..a5833f7523ce 100755 --- a/api/current.txt +++ b/api/current.txt @@ -41580,6 +41580,7 @@ package android.telecom { field public static final java.lang.String EXTRA_CALL_BACK_NUMBER = "android.telecom.extra.CALL_BACK_NUMBER"; field public static final java.lang.String EXTRA_CALL_DISCONNECT_CAUSE = "android.telecom.extra.CALL_DISCONNECT_CAUSE"; field public static final java.lang.String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecom.extra.CALL_DISCONNECT_MESSAGE"; + field public static final java.lang.String EXTRA_CALL_NETWORK_TYPE = "android.telecom.extra.CALL_NETWORK_TYPE"; field public static final java.lang.String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT"; field public static final java.lang.String EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME = "android.telecom.extra.CHANGE_DEFAULT_DIALER_PACKAGE_NAME"; field public static final java.lang.String EXTRA_INCOMING_CALL_ADDRESS = "android.telecom.extra.INCOMING_CALL_ADDRESS"; diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index 024bd303304f..a39e885204b7 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -22,6 +22,8 @@ import android.annotation.SystemApi; import android.os.Bundle; import android.os.SystemClock; import android.telecom.Connection.VideoProvider; +import android.telephony.ServiceState; +import android.telephony.TelephonyManager; import android.util.ArraySet; import java.util.ArrayList; @@ -573,6 +575,20 @@ public abstract class Conference extends Conferenceable { } /** + * Updates RIL voice radio technology used for current conference after its creation. + * + * @hide + */ + public void updateCallRadioTechAfterCreation() { + final Connection primaryConnection = getPrimaryConnection(); + if (primaryConnection != null) { + setCallRadioTech(primaryConnection.getCallRadioTech()); + } else { + Log.w(this, "No primary connection found while updateCallRadioTechAfterCreation"); + } + } + + /** * @hide * @deprecated Use {@link #setConnectionTime}. */ @@ -652,6 +668,37 @@ public abstract class Conference extends Conferenceable { } /** + * Sets RIL voice radio technology used for current conference. + * + * @param vrat the RIL voice radio technology used for current conference, + * see {@code RIL_RADIO_TECHNOLOGY_*} in {@link android.telephony.ServiceState}. + * + * @hide + */ + public final void setCallRadioTech(@ServiceState.RilRadioTechnology int vrat) { + putExtra(TelecomManager.EXTRA_CALL_NETWORK_TYPE, + ServiceState.rilRadioTechnologyToNetworkType(vrat)); + } + + /** + * Returns RIL voice radio technology used for current conference. + * + * @return the RIL voice radio technology used for current conference, + * see {@code RIL_RADIO_TECHNOLOGY_*} in {@link android.telephony.ServiceState}. + * + * @hide + */ + public final @ServiceState.RilRadioTechnology int getCallRadioTech() { + int voiceNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN; + Bundle extras = getExtras(); + if (extras != null) { + voiceNetworkType = extras.getInt(TelecomManager.EXTRA_CALL_NETWORK_TYPE, + TelephonyManager.NETWORK_TYPE_UNKNOWN); + } + return ServiceState.networkTypeToRilRadioTechnology(voiceNetworkType); + } + + /** * Inform this Conference that the state of its audio output has been changed externally. * * @param state The new audio state. diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 3d2b397ebfe8..120d17219fc0 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -38,6 +38,8 @@ import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.SystemClock; +import android.telephony.ServiceState; +import android.telephony.TelephonyManager; import android.util.ArraySet; import android.view.Surface; @@ -1885,6 +1887,24 @@ public abstract class Connection extends Conferenceable { } /** + * Returns RIL voice radio technology used for current connection. + * + * @return the RIL voice radio technology used for current connection, + * see {@code RIL_RADIO_TECHNOLOGY_*} in {@link android.telephony.ServiceState}. + * + * @hide + */ + public final @ServiceState.RilRadioTechnology int getCallRadioTech() { + int voiceNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN; + Bundle extras = getExtras(); + if (extras != null) { + voiceNetworkType = extras.getInt(TelecomManager.EXTRA_CALL_NETWORK_TYPE, + TelephonyManager.NETWORK_TYPE_UNKNOWN); + } + return ServiceState.networkTypeToRilRadioTechnology(voiceNetworkType); + } + + /** * @return The status hints for this connection. */ public final StatusHints getStatusHints() { @@ -2318,6 +2338,26 @@ public abstract class Connection extends Conferenceable { } /** + * Sets RIL voice radio technology used for current connection. + * + * @param vrat the RIL Voice Radio Technology used for current connection, + * see {@code RIL_RADIO_TECHNOLOGY_*} in {@link android.telephony.ServiceState}. + * + * @hide + */ + public final void setCallRadioTech(@ServiceState.RilRadioTechnology int vrat) { + putExtra(TelecomManager.EXTRA_CALL_NETWORK_TYPE, + ServiceState.rilRadioTechnologyToNetworkType(vrat)); + // Propagates the call radio technology to its parent {@link android.telecom.Conference} + // This action only covers non-IMS CS conference calls. + // For IMS PS call conference call, it can be updated via its host connection + // {@link #Listener.onExtrasChanged} event. + if (getConference() != null) { + getConference().setCallRadioTech(vrat); + } + } + + /** * Sets the label and icon status to display in the in-call UI. * * @param statusHints The status label and icon to set. diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 4e2282337ccd..b747dce37351 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -317,6 +317,15 @@ public class TelecomManager { "android.telecom.extra.CALL_TECHNOLOGY_TYPE"; /** + * Optional extra for communicating the call network technology used by a + * {@link android.telecom.Connection} to Telecom and InCallUI. + * + * @see {@code NETWORK_TYPE_*} in {@link android.telephony.TelephonyManager}. + */ + public static final String EXTRA_CALL_NETWORK_TYPE = + "android.telecom.extra.CALL_NETWORK_TYPE"; + + /** * An optional {@link android.content.Intent#ACTION_CALL} intent extra denoting the * package name of the app specifying an alternative gateway for the call. * The value is a string. diff --git a/telephony/java/android/telephony/ims/ImsCallProfile.java b/telephony/java/android/telephony/ims/ImsCallProfile.java index f0d3c8956962..df7bd3e6b504 100644 --- a/telephony/java/android/telephony/ims/ImsCallProfile.java +++ b/telephony/java/android/telephony/ims/ImsCallProfile.java @@ -245,7 +245,8 @@ public final class ImsCallProfile implements Parcelable { * constants, the values passed for the {@link #EXTRA_CALL_RAT_TYPE} should be strings (e.g. * "14" vs (int) 14). * Note: This is used by {@link com.android.internal.telephony.imsphone.ImsPhoneConnection# - * updateWifiStateFromExtras(Bundle)} to determine whether to set the + * updateImsCallRatFromExtras(Bundle)} to determine whether to set the + * {@link android.telecom.TelecomManager#EXTRA_CALL_NETWORK_TYPE} extra value and * {@link android.telecom.Connection#PROPERTY_WIFI} property on a connection. */ public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; |