Propagates voice call radio technology to connection

This patch mainly takes below changes:
 1) Add new extra to indicates the call network technology.
 2) Provides basic function to set/get call radio technology.

Bug: 67856372
Test: Manual
Change-Id: I1a12382fdb589ce823fe7af025832db4cdc152c2
This commit is contained in:
Wei Huang
2018-05-30 19:21:36 +08:00
committed by Takeshi Tanigawa
parent e860c63891
commit 7f7f72e451
5 changed files with 99 additions and 1 deletions

View File

@@ -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;
@@ -1878,6 +1880,24 @@ public abstract class Connection extends Conferenceable {
return mConnectElapsedTimeMillis;
}
/**
* 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.
*/
@@ -2311,6 +2331,26 @@ public abstract class Connection extends Conferenceable {
mConnectElapsedTimeMillis = connectElapsedTimeMillis;
}
/**
* 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.
*