Merge "Finalize MEP functionality." into nyc-mr1-dev

This commit is contained in:
Tyler Gunn
2016-07-11 21:53:00 +00:00
committed by Android (Google) Code Review
10 changed files with 85 additions and 3 deletions

View File

@@ -1551,6 +1551,8 @@ public abstract class Connection extends Conferenceable {
return "RINGING"; return "RINGING";
case STATE_DIALING: case STATE_DIALING:
return "DIALING"; return "DIALING";
case STATE_PULLING_CALL:
return "PULLING_CALL";
case STATE_ACTIVE: case STATE_ACTIVE:
return "ACTIVE"; return "ACTIVE";
case STATE_HOLDING: case STATE_HOLDING:

View File

@@ -556,6 +556,9 @@ public abstract class ConnectionService extends Service {
case Connection.STATE_DIALING: case Connection.STATE_DIALING:
mAdapter.setDialing(id); mAdapter.setDialing(id);
break; break;
case Connection.STATE_PULLING_CALL:
mAdapter.setPulling(id);
break;
case Connection.STATE_DISCONNECTED: case Connection.STATE_DISCONNECTED:
// Handled in onDisconnected() // Handled in onDisconnected()
break; break;

View File

@@ -142,6 +142,21 @@ final class ConnectionServiceAdapter implements DeathRecipient {
} }
} }
/**
* Sets a call's state to pulling (e.g. a call with {@link Connection#PROPERTY_IS_EXTERNAL_CALL}
* is being pulled to the local device.
*
* @param callId The unique ID of the call whose state is changing to dialing.
*/
void setPulling(String callId) {
for (IConnectionServiceAdapter adapter : mAdapters) {
try {
adapter.setPulling(callId);
} catch (RemoteException e) {
}
}
}
/** /**
* Sets a call's state to disconnected. * Sets a call's state to disconnected.
* *

View File

@@ -65,6 +65,7 @@ final class ConnectionServiceAdapterServant {
private static final int MSG_REMOVE_EXTRAS = 25; private static final int MSG_REMOVE_EXTRAS = 25;
private static final int MSG_ON_CONNECTION_EVENT = 26; private static final int MSG_ON_CONNECTION_EVENT = 26;
private static final int MSG_SET_CONNECTION_PROPERTIES = 27; private static final int MSG_SET_CONNECTION_PROPERTIES = 27;
private static final int MSG_SET_PULLING = 28;
private final IConnectionServiceAdapter mDelegate; private final IConnectionServiceAdapter mDelegate;
@@ -101,6 +102,9 @@ final class ConnectionServiceAdapterServant {
case MSG_SET_DIALING: case MSG_SET_DIALING:
mDelegate.setDialing((String) msg.obj); mDelegate.setDialing((String) msg.obj);
break; break;
case MSG_SET_PULLING:
mDelegate.setPulling((String) msg.obj);
break;
case MSG_SET_DISCONNECTED: { case MSG_SET_DISCONNECTED: {
SomeArgs args = (SomeArgs) msg.obj; SomeArgs args = (SomeArgs) msg.obj;
try { try {
@@ -298,6 +302,11 @@ final class ConnectionServiceAdapterServant {
mHandler.obtainMessage(MSG_SET_DIALING, connectionId).sendToTarget(); mHandler.obtainMessage(MSG_SET_DIALING, connectionId).sendToTarget();
} }
@Override
public void setPulling(String connectionId) {
mHandler.obtainMessage(MSG_SET_PULLING, connectionId).sendToTarget();
}
@Override @Override
public void setDisconnected( public void setDisconnected(
String connectionId, DisconnectCause disconnectCause) { String connectionId, DisconnectCause disconnectCause) {

View File

@@ -117,6 +117,12 @@ final class RemoteConnectionService {
.setState(Connection.STATE_DIALING); .setState(Connection.STATE_DIALING);
} }
@Override
public void setPulling(String callId) {
findConnectionForAction(callId, "setPulling")
.setState(Connection.STATE_PULLING_CALL);
}
@Override @Override
public void setDisconnected(String callId, DisconnectCause disconnectCause) { public void setDisconnected(String callId, DisconnectCause disconnectCause) {
if (mConnectionById.containsKey(callId)) { if (mConnectionById.containsKey(callId)) {

View File

@@ -47,6 +47,8 @@ oneway interface IConnectionServiceAdapter {
void setDialing(String callId); void setDialing(String callId);
void setPulling(String callId);
void setDisconnected(String callId, in DisconnectCause disconnectCause); void setDisconnected(String callId, in DisconnectCause disconnectCause);
void setOnHold(String callId); void setOnHold(String callId);

View File

@@ -24,6 +24,7 @@ import android.os.PersistableBundle;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.ServiceManager; import android.os.ServiceManager;
import com.android.ims.ImsReasonInfo;
import com.android.internal.telephony.ICarrierConfigLoader; import com.android.internal.telephony.ICarrierConfigLoader;
/** /**
@@ -836,6 +837,25 @@ public class CarrierConfigManager {
public static final String KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL = public static final String KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL =
"allow_add_call_during_video_call"; "allow_add_call_during_video_call";
/**
* Defines operator-specific {@link com.android.ims.ImsReasonInfo} mappings.
*
* Format: "ORIGINAL_CODE|MESSAGE|NEW_CODE"
* Where {@code ORIGINAL_CODE} corresponds to a {@link ImsReasonInfo#getCode()} code,
* {@code MESSAGE} corresponds to an expected {@link ImsReasonInfo#getExtraMessage()} string,
* and {@code NEW_CODE} is the new {@code ImsReasonInfo#CODE_*} which this combination of
* original code and message shall be remapped to.
*
* Example: "501|call completion elsewhere|1014"
* When the {@link ImsReasonInfo#getCode()} is {@link ImsReasonInfo#CODE_USER_TERMINATED} and
* the {@link ImsReasonInfo#getExtraMessage()} is {@code "call completion elsewhere"},
* {@link ImsReasonInfo#CODE_ANSWERED_ELSEWHERE} shall be used as the {@link ImsReasonInfo}
* code instead.
* @hide
*/
public static final String KEY_IMS_REASONINFO_MAPPING_STRING_ARRAY =
"ims_reasoninfo_mapping_string_array";
/** The default value for every variable. */ /** The default value for every variable. */
private final static PersistableBundle sDefaults; private final static PersistableBundle sDefaults;
@@ -992,6 +1012,8 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_DROP_VIDEO_CALL_WHEN_ANSWERING_AUDIO_CALL_BOOL, false); sDefaults.putBoolean(KEY_DROP_VIDEO_CALL_WHEN_ANSWERING_AUDIO_CALL_BOOL, false);
sDefaults.putBoolean(KEY_ALLOW_MERGE_WIFI_CALLS_WHEN_VOWIFI_OFF_BOOL, true); sDefaults.putBoolean(KEY_ALLOW_MERGE_WIFI_CALLS_WHEN_VOWIFI_OFF_BOOL, true);
sDefaults.putBoolean(KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL, true); sDefaults.putBoolean(KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL, true);
sDefaults.putStringArray(KEY_IMS_REASONINFO_MAPPING_STRING_ARRAY, null);
} }
/** /**

View File

@@ -206,6 +206,12 @@ public class DisconnectCause {
*/ */
public static final int ANSWERED_ELSEWHERE = 52; public static final int ANSWERED_ELSEWHERE = 52;
/**
* The call was terminated because the maximum allowable number of calls has been reached.
* {@hide}
*/
public static final int MAXIMUM_NUMBER_OF_CALLS_REACHED = 53;
//********************************************************************************************* //*********************************************************************************************
// When adding a disconnect type: // When adding a disconnect type:
// 1) Please assign the new type the next id value below. // 1) Please assign the new type the next id value below.
@@ -214,14 +220,14 @@ public class DisconnectCause {
// 4) Update toString() with the newly added disconnect type. // 4) Update toString() with the newly added disconnect type.
// 5) Update android.telecom.DisconnectCauseUtil with any mappings to a telecom.DisconnectCause. // 5) Update android.telecom.DisconnectCauseUtil with any mappings to a telecom.DisconnectCause.
// //
// NextId: 53 // NextId: 54
//********************************************************************************************* //*********************************************************************************************
/** Smallest valid value for call disconnect codes. */ /** Smallest valid value for call disconnect codes. */
public static final int MINIMUM_VALID_VALUE = NOT_DISCONNECTED; public static final int MINIMUM_VALID_VALUE = NOT_DISCONNECTED;
/** Largest valid value for call disconnect codes. */ /** Largest valid value for call disconnect codes. */
public static final int MAXIMUM_VALID_VALUE = ANSWERED_ELSEWHERE; public static final int MAXIMUM_VALID_VALUE = MAXIMUM_NUMBER_OF_CALLS_REACHED;
/** Private constructor to avoid class instantiation. */ /** Private constructor to avoid class instantiation. */
private DisconnectCause() { private DisconnectCause() {
@@ -335,6 +341,8 @@ public class DisconnectCause {
return "CALL_PULLED"; return "CALL_PULLED";
case ANSWERED_ELSEWHERE: case ANSWERED_ELSEWHERE:
return "ANSWERED_ELSEWHERE"; return "ANSWERED_ELSEWHERE";
case MAXIMUM_NUMBER_OF_CALLS_REACHED:
return "MAXIMUM_NUMER_OF_CALLS_REACHED";
default: default:
return "INVALID: " + cause; return "INVALID: " + cause;
} }

View File

@@ -19,6 +19,7 @@ package com.android.ims;
import android.net.Uri; import android.net.Uri;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.telecom.Log;
import android.telephony.Rlog; import android.telephony.Rlog;
/* /*
@@ -130,7 +131,7 @@ public class ImsExternalCallState implements Parcelable {
@Override @Override
public String toString() { public String toString() {
return "ImsExternalCallState { mCallId = " + mCallId + return "ImsExternalCallState { mCallId = " + mCallId +
", mAddress = " + mAddress + ", mAddress = " + Log.pii(mAddress) +
", mIsPullable = " + mIsPullable + ", mIsPullable = " + mIsPullable +
", mCallState = " + mCallState + ", mCallState = " + mCallState +
", mCallType = " + mCallType + ", mCallType = " + mCallType +

View File

@@ -25,6 +25,7 @@ import android.os.Parcelable;
* @hide * @hide
*/ */
public class ImsReasonInfo implements Parcelable { public class ImsReasonInfo implements Parcelable {
/** /**
* Specific code of each types * Specific code of each types
*/ */
@@ -283,6 +284,19 @@ public class ImsReasonInfo implements Parcelable {
*/ */
public static final int CODE_EPDG_TUNNEL_LOST_CONNECTION = 1402; public static final int CODE_EPDG_TUNNEL_LOST_CONNECTION = 1402;
/**
* The maximum number of calls allowed has been reached. Used in a multi-endpoint scenario
* where the number of calls across all connected devices has reached the maximum.
*/
public static final int CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED = 1403;
/**
* Similar to {@link #CODE_LOCAL_CALL_DECLINE}, except indicates that a remote device has
* declined the call. Used in a multi-endpoint scenario where a remote device declined an
* incoming call.
*/
public static final int CODE_REMOTE_CALL_DECLINE = 1404;
/** /**
* Network string error messages. * Network string error messages.
* mExtraMessage may have these values. * mExtraMessage may have these values.