Loading telecomm/java/android/telecom/Call.java +17 −4 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ public final class Call { private final int mVideoState; private final StatusHints mStatusHints; private final Bundle mExtras; private final int mCallSubstate; /** * @return The handle (e.g., phone number) to which the {@code Call} is currently Loading Loading @@ -212,6 +213,13 @@ public final class Call { return mExtras; } /** * @return The substate of the {@code Call}. */ public int getCallSubstate() { return mCallSubstate; } @Override public boolean equals(Object o) { if (o instanceof Details) { Loading @@ -230,7 +238,8 @@ public final class Call { Objects.equals(mGatewayInfo, d.mGatewayInfo) && Objects.equals(mVideoState, d.mVideoState) && Objects.equals(mStatusHints, d.mStatusHints) && Objects.equals(mExtras, d.mExtras); Objects.equals(mExtras, d.mExtras) && Objects.equals(mCallSubstate, d.mCallSubstate); } return false; } Loading @@ -250,7 +259,8 @@ public final class Call { Objects.hashCode(mGatewayInfo) + Objects.hashCode(mVideoState) + Objects.hashCode(mStatusHints) + Objects.hashCode(mExtras); Objects.hashCode(mExtras) + Objects.hashCode(mCallSubstate); } /** {@hide} */ Loading @@ -267,7 +277,8 @@ public final class Call { GatewayInfo gatewayInfo, int videoState, StatusHints statusHints, Bundle extras) { Bundle extras, int callSubstate) { mHandle = handle; mHandlePresentation = handlePresentation; mCallerDisplayName = callerDisplayName; Loading @@ -281,6 +292,7 @@ public final class Call { mVideoState = videoState; mStatusHints = statusHints; mExtras = extras; mCallSubstate = callSubstate; } } Loading Loading @@ -686,7 +698,8 @@ public final class Call { parcelableCall.getGatewayInfo(), parcelableCall.getVideoState(), parcelableCall.getStatusHints(), parcelableCall.getExtras()); parcelableCall.getExtras(), parcelableCall.getCallSubstate()); boolean detailsChanged = !Objects.equals(mDetails, details); if (detailsChanged) { mDetails = details; Loading telecomm/java/android/telecom/Connection.java +55 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,25 @@ public abstract class Connection { public static final int STATE_DISCONNECTED = 6; /** * Call substate bitmask values */ /* Default case */ public static final int CALL_SUBSTATE_NONE = 0; /* Indicates that the call is connected but audio attribute is suspended */ public static final int CALL_SUBSTATE_AUDIO_CONNECTED_SUSPENDED = 0x1; /* Indicates that the call is connected but video attribute is suspended */ public static final int CALL_SUBSTATE_VIDEO_CONNECTED_SUSPENDED = 0x2; /* Indicates that the call is established but media retry is needed */ public static final int CALL_SUBSTATE_AVP_RETRY = 0x4; /* Indicates that the call is multitasking */ public static final int CALL_SUBSTATE_MEDIA_PAUSED = 0x8; // Flag controlling whether PII is emitted into the logs private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG); Loading @@ -87,6 +106,7 @@ public abstract class Connection { Connection c, List<Connection> conferenceableConnections) {} public void onConferenceChanged(Connection c, Conference conference) {} public void onPhoneAccountChanged(Connection c, PhoneAccountHandle pHandle) {} public void onCallSubstateChanged(Connection c, int substate) {} } /** @hide */ Loading Loading @@ -501,6 +521,7 @@ public abstract class Connection { private Conference mConference; private ConnectionService mConnectionService; private PhoneAccountHandle mPhoneAccountHandle = null; private int mCallSubstate; /** * Create a new Connection. Loading Loading @@ -558,6 +579,21 @@ public abstract class Connection { return mVideoState; } /** * Returns the call substate of the call. * Valid values: {@link Connection#CALL_SUBSTATE_NONE}, * {@link Connection#CALL_SUBSTATE_AUDIO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_VIDEO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_AVP_RETRY}, * {@link Connection#CALL_SUBSTATE_MEDIA_PAUSED}. * * @param callSubstate The new call substate. * @hide */ public final int getCallSubstate() { return mCallSubstate; } /** * @return The audio state of the call, describing how its audio is currently * being routed by the system. This is {@code null} if this Connection Loading Loading @@ -727,6 +763,25 @@ public abstract class Connection { } } /** * Set the call substate for the connection. * Valid values: {@link Connection#CALL_SUBSTATE_NONE}, * {@link Connection#CALL_SUBSTATE_AUDIO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_VIDEO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_AVP_RETRY}, * {@link Connection#CALL_SUBSTATE_MEDIA_PAUSED}. * * @param callSubstate The new call substate. * @hide */ public final void setCallSubstate(int callSubstate) { Log.d(this, "setCallSubstate %d", callSubstate); mCallSubstate = callSubstate; for (Listener l : mListeners) { l.onCallSubstateChanged(this, mCallSubstate); } } /** * Sets state to active (e.g., an ongoing call where two or more parties can actively * communicate). Loading telecomm/java/android/telecom/ConnectionService.java +9 −1 Original line number Diff line number Diff line Loading @@ -577,6 +577,13 @@ public abstract class ConnectionService extends Service { Log.i(this, "Adapter onPhoneAccountChanged %s, %s", c, pHandle); mAdapter.setPhoneAccountHandle(id, pHandle); } @Override public void onCallSubstateChanged(Connection c, int callSubstate) { String id = mIdByConnection.get(c); Log.d(this, "Adapter set call substate %d", callSubstate); mAdapter.setCallSubstate(id, callSubstate); } }; /** {@inheritDoc} */ Loading Loading @@ -646,7 +653,8 @@ public abstract class ConnectionService extends Service { connection.getAudioModeIsVoip(), connection.getStatusHints(), connection.getDisconnectCause(), createConnectionIdList(connection.getConferenceableConnections()))); createConnectionIdList(connection.getConferenceableConnections()), connection.getCallSubstate())); } /** @hide */ Loading telecomm/java/android/telecom/ConnectionServiceAdapter.java +22 −0 Original line number Diff line number Diff line Loading @@ -375,4 +375,26 @@ final class ConnectionServiceAdapter implements DeathRecipient { } } } /** * Set the call substate for the connection. * Valid values: {@link Connection#CALL_SUBSTATE_NONE}, * {@link Connection#CALL_SUBSTATE_AUDIO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_VIDEO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_AVP_RETRY}, * {@link Connection#CALL_SUBSTATE_MEDIA_PAUSED}. * * @param callId The unique ID of the call to set the substate for. * @param callSubstate The new call substate. * @hide */ public final void setCallSubstate(String callId, int callSubstate) { Log.v(this, "setCallSubstate: %d", callSubstate); for (IConnectionServiceAdapter adapter : mAdapters) { try { adapter.setCallSubstate(callId, callSubstate); } catch (RemoteException ignored) { } } } } telecomm/java/android/telecom/ConnectionServiceAdapterServant.java +11 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ final class ConnectionServiceAdapterServant { private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20; private static final int MSG_SET_DISCONNECTED_WITH_SUPP_NOTIFICATION = 21; private static final int MSG_SET_PHONE_ACCOUNT = 22; private static final int MSG_SET_CALL_SUBSTATE = 23; private final IConnectionServiceAdapter mDelegate; Loading Loading @@ -222,6 +223,10 @@ final class ConnectionServiceAdapterServant { } break; } case MSG_SET_CALL_SUBSTATE: { mDelegate.setCallSubstate((String) msg.obj, msg.arg1); break; } } } }; Loading Loading @@ -390,6 +395,12 @@ final class ConnectionServiceAdapterServant { args.arg2 = pHandle; mHandler.obtainMessage(MSG_SET_PHONE_ACCOUNT, args).sendToTarget(); } @Override public void setCallSubstate(String connectionId, int callSubstate) { mHandler.obtainMessage(MSG_SET_CALL_SUBSTATE, callSubstate, 0, connectionId).sendToTarget(); } }; public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) { Loading Loading
telecomm/java/android/telecom/Call.java +17 −4 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ public final class Call { private final int mVideoState; private final StatusHints mStatusHints; private final Bundle mExtras; private final int mCallSubstate; /** * @return The handle (e.g., phone number) to which the {@code Call} is currently Loading Loading @@ -212,6 +213,13 @@ public final class Call { return mExtras; } /** * @return The substate of the {@code Call}. */ public int getCallSubstate() { return mCallSubstate; } @Override public boolean equals(Object o) { if (o instanceof Details) { Loading @@ -230,7 +238,8 @@ public final class Call { Objects.equals(mGatewayInfo, d.mGatewayInfo) && Objects.equals(mVideoState, d.mVideoState) && Objects.equals(mStatusHints, d.mStatusHints) && Objects.equals(mExtras, d.mExtras); Objects.equals(mExtras, d.mExtras) && Objects.equals(mCallSubstate, d.mCallSubstate); } return false; } Loading @@ -250,7 +259,8 @@ public final class Call { Objects.hashCode(mGatewayInfo) + Objects.hashCode(mVideoState) + Objects.hashCode(mStatusHints) + Objects.hashCode(mExtras); Objects.hashCode(mExtras) + Objects.hashCode(mCallSubstate); } /** {@hide} */ Loading @@ -267,7 +277,8 @@ public final class Call { GatewayInfo gatewayInfo, int videoState, StatusHints statusHints, Bundle extras) { Bundle extras, int callSubstate) { mHandle = handle; mHandlePresentation = handlePresentation; mCallerDisplayName = callerDisplayName; Loading @@ -281,6 +292,7 @@ public final class Call { mVideoState = videoState; mStatusHints = statusHints; mExtras = extras; mCallSubstate = callSubstate; } } Loading Loading @@ -686,7 +698,8 @@ public final class Call { parcelableCall.getGatewayInfo(), parcelableCall.getVideoState(), parcelableCall.getStatusHints(), parcelableCall.getExtras()); parcelableCall.getExtras(), parcelableCall.getCallSubstate()); boolean detailsChanged = !Objects.equals(mDetails, details); if (detailsChanged) { mDetails = details; Loading
telecomm/java/android/telecom/Connection.java +55 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,25 @@ public abstract class Connection { public static final int STATE_DISCONNECTED = 6; /** * Call substate bitmask values */ /* Default case */ public static final int CALL_SUBSTATE_NONE = 0; /* Indicates that the call is connected but audio attribute is suspended */ public static final int CALL_SUBSTATE_AUDIO_CONNECTED_SUSPENDED = 0x1; /* Indicates that the call is connected but video attribute is suspended */ public static final int CALL_SUBSTATE_VIDEO_CONNECTED_SUSPENDED = 0x2; /* Indicates that the call is established but media retry is needed */ public static final int CALL_SUBSTATE_AVP_RETRY = 0x4; /* Indicates that the call is multitasking */ public static final int CALL_SUBSTATE_MEDIA_PAUSED = 0x8; // Flag controlling whether PII is emitted into the logs private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG); Loading @@ -87,6 +106,7 @@ public abstract class Connection { Connection c, List<Connection> conferenceableConnections) {} public void onConferenceChanged(Connection c, Conference conference) {} public void onPhoneAccountChanged(Connection c, PhoneAccountHandle pHandle) {} public void onCallSubstateChanged(Connection c, int substate) {} } /** @hide */ Loading Loading @@ -501,6 +521,7 @@ public abstract class Connection { private Conference mConference; private ConnectionService mConnectionService; private PhoneAccountHandle mPhoneAccountHandle = null; private int mCallSubstate; /** * Create a new Connection. Loading Loading @@ -558,6 +579,21 @@ public abstract class Connection { return mVideoState; } /** * Returns the call substate of the call. * Valid values: {@link Connection#CALL_SUBSTATE_NONE}, * {@link Connection#CALL_SUBSTATE_AUDIO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_VIDEO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_AVP_RETRY}, * {@link Connection#CALL_SUBSTATE_MEDIA_PAUSED}. * * @param callSubstate The new call substate. * @hide */ public final int getCallSubstate() { return mCallSubstate; } /** * @return The audio state of the call, describing how its audio is currently * being routed by the system. This is {@code null} if this Connection Loading Loading @@ -727,6 +763,25 @@ public abstract class Connection { } } /** * Set the call substate for the connection. * Valid values: {@link Connection#CALL_SUBSTATE_NONE}, * {@link Connection#CALL_SUBSTATE_AUDIO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_VIDEO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_AVP_RETRY}, * {@link Connection#CALL_SUBSTATE_MEDIA_PAUSED}. * * @param callSubstate The new call substate. * @hide */ public final void setCallSubstate(int callSubstate) { Log.d(this, "setCallSubstate %d", callSubstate); mCallSubstate = callSubstate; for (Listener l : mListeners) { l.onCallSubstateChanged(this, mCallSubstate); } } /** * Sets state to active (e.g., an ongoing call where two or more parties can actively * communicate). Loading
telecomm/java/android/telecom/ConnectionService.java +9 −1 Original line number Diff line number Diff line Loading @@ -577,6 +577,13 @@ public abstract class ConnectionService extends Service { Log.i(this, "Adapter onPhoneAccountChanged %s, %s", c, pHandle); mAdapter.setPhoneAccountHandle(id, pHandle); } @Override public void onCallSubstateChanged(Connection c, int callSubstate) { String id = mIdByConnection.get(c); Log.d(this, "Adapter set call substate %d", callSubstate); mAdapter.setCallSubstate(id, callSubstate); } }; /** {@inheritDoc} */ Loading Loading @@ -646,7 +653,8 @@ public abstract class ConnectionService extends Service { connection.getAudioModeIsVoip(), connection.getStatusHints(), connection.getDisconnectCause(), createConnectionIdList(connection.getConferenceableConnections()))); createConnectionIdList(connection.getConferenceableConnections()), connection.getCallSubstate())); } /** @hide */ Loading
telecomm/java/android/telecom/ConnectionServiceAdapter.java +22 −0 Original line number Diff line number Diff line Loading @@ -375,4 +375,26 @@ final class ConnectionServiceAdapter implements DeathRecipient { } } } /** * Set the call substate for the connection. * Valid values: {@link Connection#CALL_SUBSTATE_NONE}, * {@link Connection#CALL_SUBSTATE_AUDIO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_VIDEO_CONNECTED_SUSPENDED}, * {@link Connection#CALL_SUBSTATE_AVP_RETRY}, * {@link Connection#CALL_SUBSTATE_MEDIA_PAUSED}. * * @param callId The unique ID of the call to set the substate for. * @param callSubstate The new call substate. * @hide */ public final void setCallSubstate(String callId, int callSubstate) { Log.v(this, "setCallSubstate: %d", callSubstate); for (IConnectionServiceAdapter adapter : mAdapters) { try { adapter.setCallSubstate(callId, callSubstate); } catch (RemoteException ignored) { } } } }
telecomm/java/android/telecom/ConnectionServiceAdapterServant.java +11 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ final class ConnectionServiceAdapterServant { private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20; private static final int MSG_SET_DISCONNECTED_WITH_SUPP_NOTIFICATION = 21; private static final int MSG_SET_PHONE_ACCOUNT = 22; private static final int MSG_SET_CALL_SUBSTATE = 23; private final IConnectionServiceAdapter mDelegate; Loading Loading @@ -222,6 +223,10 @@ final class ConnectionServiceAdapterServant { } break; } case MSG_SET_CALL_SUBSTATE: { mDelegate.setCallSubstate((String) msg.obj, msg.arg1); break; } } } }; Loading Loading @@ -390,6 +395,12 @@ final class ConnectionServiceAdapterServant { args.arg2 = pHandle; mHandler.obtainMessage(MSG_SET_PHONE_ACCOUNT, args).sendToTarget(); } @Override public void setCallSubstate(String connectionId, int callSubstate) { mHandler.obtainMessage(MSG_SET_CALL_SUBSTATE, callSubstate, 0, connectionId).sendToTarget(); } }; public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) { Loading