From 404babbb989c414c99e52ad0878f0f247c780416 Mon Sep 17 00:00:00 2001 From: Ravi Paluri Date: Thu, 23 Jan 2020 19:02:44 +0530 Subject: [PATCH 1/2] Ims: Add support to add participants to existing call Supports initiation of a conference call by directly adding participants to existing call Test: Manual Bug: 62151032 Change-Id: I4e60efafab4761ae65a460fdc6c4cacc3e233220 --- api/current.txt | 6 +++ telecomm/java/android/telecom/Call.java | 18 +++++++- telecomm/java/android/telecom/Conference.java | 6 +++ telecomm/java/android/telecom/Connection.java | 18 +++++++- .../android/telecom/ConnectionService.java | 41 +++++++++++++++++++ .../java/android/telecom/InCallAdapter.java | 14 +++++++ .../internal/telecom/IConnectionService.aidl | 3 ++ .../internal/telecom/IInCallAdapter.aidl | 2 + .../telephony/CarrierConfigManager.java | 8 ++++ 9 files changed, 113 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index 6b90fbb1c4109..5b618ed738045 100644 --- a/api/current.txt +++ b/api/current.txt @@ -43553,6 +43553,7 @@ package android.system { package android.telecom { public final class Call { + method public void addConferenceParticipants(@NonNull java.util.List); method public void answer(int); method public void conference(android.telecom.Call); method public void deflect(android.net.Uri); @@ -43661,6 +43662,7 @@ package android.telecom { method public static boolean hasProperty(int, int); method public boolean hasProperty(int); method public static String propertiesToString(int); + field public static final int CAPABILITY_ADD_PARTICIPANT = 33554432; // 0x2000000 field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 4194304; // 0x400000 field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000 field public static final int CAPABILITY_CAN_PULL_CALL = 8388608; // 0x800000 @@ -43781,6 +43783,7 @@ package android.telecom { method public final android.telecom.StatusHints getStatusHints(); method public android.telecom.Connection.VideoProvider getVideoProvider(); method public int getVideoState(); + method public void onAddConferenceParticipants(@NonNull java.util.List); method public void onCallAudioStateChanged(android.telecom.CallAudioState); method public void onConnectionAdded(android.telecom.Connection); method public void onDisconnect(); @@ -43844,6 +43847,7 @@ package android.telecom { method public final boolean isRingbackRequested(); method public final void notifyConferenceMergeFailed(); method public void onAbort(); + method public void onAddConferenceParticipants(@NonNull java.util.List); method public void onAnswer(int); method public void onAnswer(); method public void onCallAudioStateChanged(android.telecom.CallAudioState); @@ -43923,6 +43927,7 @@ package android.telecom { field public static final int AUDIO_CODEC_GSM_HR = 10; // 0xa field public static final int AUDIO_CODEC_NONE = 0; // 0x0 field public static final int AUDIO_CODEC_QCELP13K = 3; // 0x3 + field public static final int CAPABILITY_ADD_PARTICIPANT = 67108864; // 0x4000000 field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000 field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000 field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000 @@ -44896,6 +44901,7 @@ package android.telephony { field public static final String KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_bool"; field public static final String KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL = "sms_requires_destination_number_conversion_bool"; field public static final String KEY_SUPPORT_3GPP_CALL_FORWARDING_WHILE_ROAMING_BOOL = "support_3gpp_call_forwarding_while_roaming_bool"; + field public static final String KEY_SUPPORT_ADD_CONFERENCE_PARTICIPANTS_BOOL = "support_add_conference_participants_bool"; field public static final String KEY_SUPPORT_CLIR_NETWORK_DEFAULT_BOOL = "support_clir_network_default_bool"; field public static final String KEY_SUPPORT_CONFERENCE_CALL_BOOL = "support_conference_call_bool"; field public static final String KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL = "support_emergency_sms_over_ims_bool"; diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index ec99f36f6e707..ecb2e003007a9 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -17,6 +17,7 @@ package android.telecom; import android.annotation.IntDef; +import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.TestApi; @@ -458,8 +459,10 @@ public final class Call { /** Call supports the deflect feature. */ public static final int CAPABILITY_SUPPORT_DEFLECT = 0x01000000; + /** call supports adding participants to existing call */ + public static final int CAPABILITY_ADD_PARTICIPANT = 0x02000000; //****************************************************************************************** - // Next CAPABILITY value: 0x02000000 + // Next CAPABILITY value: 0x04000000 //****************************************************************************************** /** @@ -689,6 +692,9 @@ public final class Call { if (can(capabilities, CAPABILITY_SUPPORT_DEFLECT)) { builder.append(" CAPABILITY_SUPPORT_DEFLECT"); } + if (can(capabilities, CAPABILITY_ADD_PARTICIPANT)) { + builder.append(" CAPABILITY_ADD_PARTICIPANT"); + } builder.append("]"); return builder.toString(); } @@ -1702,6 +1708,16 @@ public final class Call { mInCallAdapter.swapConference(mTelecomCallId); } + /** + * Pulls participants to existing call by forming a conference call. + * See {@link Details#CAPABILITY_ADD_PARTICIPANT}. + * + * @param participants participants to be pulled to existing call. + */ + public void addConferenceParticipants(@NonNull List participants) { + mInCallAdapter.addConferenceParticipants(mTelecomCallId, participants); + } + /** * Initiates a request to the {@link ConnectionService} to pull an external call to the local * device. diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index 56acdff530ebf..1b6b1eab58404 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -318,6 +318,12 @@ public abstract class Conference extends Conferenceable { */ public void onConnectionAdded(Connection connection) {} + /** + * Notifies the {@link Conference} of a request to add a new participant to the conference call + * @param participants that will be added to existing conference call + */ + public void onAddConferenceParticipants(@NonNull List participants) {} + /** * Notifies this Conference, which is in {@code STATE_RINGING}, of * a request to accept. diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 8049459cf3f4d..f974be5d9a411 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -376,8 +376,13 @@ public abstract class Connection extends Conferenceable { /** Call supports the deflect feature. */ public static final int CAPABILITY_SUPPORT_DEFLECT = 0x02000000; + /** + * When set, indicates that this {@link Connection} supports initiation of a conference call + * by directly adding a participant using {@link #onAddConferenceParticipants()}. + */ + public static final int CAPABILITY_ADD_PARTICIPANT = 0x04000000; //********************************************************************************************** - // Next CAPABILITY value: 0x04000000 + // Next CAPABILITY value: 0x08000000 //********************************************************************************************** /** @@ -953,7 +958,9 @@ public abstract class Connection extends Conferenceable { if ((capabilities & CAPABILITY_SUPPORT_DEFLECT) == CAPABILITY_SUPPORT_DEFLECT) { builder.append(isLong ? " CAPABILITY_SUPPORT_DEFLECT" : " sup_def"); } - + if ((capabilities & CAPABILITY_ADD_PARTICIPANT) == CAPABILITY_ADD_PARTICIPANT) { + builder.append(isLong ? " CAPABILITY_ADD_PARTICIPANT" : " add_participant"); + } builder.append("]"); return builder.toString(); } @@ -2952,6 +2959,13 @@ public abstract class Connection extends Conferenceable { */ public void onSeparate() {} + /** + * Supports initiation of a conference call by directly adding participants. + * + * @param participants with which conference call will be formed. + */ + public void onAddConferenceParticipants(@NonNull List participants) {} + /** * Notifies this Connection of a request to abort. */ diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 00c2918837acb..f2141d31b596e 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -142,6 +142,7 @@ public abstract class ConnectionService extends Service { private static final String SESSION_SPLIT_CONFERENCE = "CS.sFC"; private static final String SESSION_MERGE_CONFERENCE = "CS.mC"; private static final String SESSION_SWAP_CONFERENCE = "CS.sC"; + private static final String SESSION_ADD_PARTICIPANT = "CS.aP"; private static final String SESSION_POST_DIAL_CONT = "CS.oPDC"; private static final String SESSION_PULL_EXTERNAL_CALL = "CS.pEC"; private static final String SESSION_SEND_CALL_EVENT = "CS.sCE"; @@ -195,6 +196,7 @@ public abstract class ConnectionService extends Service { private static final int MSG_CREATE_CONFERENCE_COMPLETE = 36; private static final int MSG_CREATE_CONFERENCE_FAILED = 37; private static final int MSG_REJECT_WITH_REASON = 38; + private static final int MSG_ADD_PARTICIPANT = 39; private static Connection sNullConnection; @@ -626,6 +628,21 @@ public abstract class ConnectionService extends Service { } } + @Override + public void addConferenceParticipants(String callId, List participants, + Session.Info sessionInfo) { + Log.startSession(sessionInfo, SESSION_ADD_PARTICIPANT); + try { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = participants; + args.arg3 = Log.createSubsession(); + mHandler.obtainMessage(MSG_ADD_PARTICIPANT, args).sendToTarget(); + } finally { + Log.endSession(); + } + } + @Override public void onPostDialContinue(String callId, boolean proceed, Session.Info sessionInfo) { Log.startSession(sessionInfo, SESSION_POST_DIAL_CONT); @@ -1224,6 +1241,19 @@ public abstract class ConnectionService extends Service { } break; } + case MSG_ADD_PARTICIPANT: { + SomeArgs args = (SomeArgs) msg.obj; + try { + Log.continueSession((Session) args.arg3, + SESSION_HANDLER + SESSION_ADD_PARTICIPANT); + addConferenceParticipants((String) args.arg1, (List)args.arg2); + } finally { + args.recycle(); + Log.endSession(); + } + break; + } + case MSG_ON_POST_DIAL_CONTINUE: { SomeArgs args = (SomeArgs) msg.obj; try { @@ -2152,6 +2182,17 @@ public abstract class ConnectionService extends Service { } } + private void addConferenceParticipants(String callId, List participants) { + Log.d(this, "addConferenceParticipants(%s)", callId); + if (mConnectionById.containsKey(callId)) { + findConnectionForAction(callId, "addConferenceParticipants") + .onAddConferenceParticipants(participants); + } else { + findConferenceForAction(callId, "addConferenceParticipants") + .onAddConferenceParticipants(participants); + } + } + /** * Notifies a {@link Connection} of a request to pull an external call. * diff --git a/telecomm/java/android/telecom/InCallAdapter.java b/telecomm/java/android/telecom/InCallAdapter.java index 594c1eb392b3b..9d29174059ade 100644 --- a/telecomm/java/android/telecom/InCallAdapter.java +++ b/telecomm/java/android/telecom/InCallAdapter.java @@ -282,6 +282,20 @@ public final class InCallAdapter { } } + /** + * Instructs Telecom to pull participants to existing call + * + * @param callId The unique ID of the call. + * @param participants participants to be pulled to existing call. + */ + public void addConferenceParticipants(String callId, List participants) { + try { + mAdapter.addConferenceParticipants(callId, participants); + } catch (RemoteException ignored) { + } + } + + /** * Instructs Telecom to split the specified call from any conference call with which it may be * connected. diff --git a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl index 4249dff151c77..a397d77db2f66 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl @@ -104,6 +104,9 @@ oneway interface IConnectionService { void swapConference(String conferenceCallId, in Session.Info sessionInfo); + void addConferenceParticipants(String CallId, in List participants, + in Session.Info sessionInfo); + void onPostDialContinue(String callId, boolean proceed, in Session.Info sessionInfo); void pullExternalCall(String callId, in Session.Info sessionInfo); diff --git a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl index eb2d714fe3f4c..9beff22ce52eb 100644 --- a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl @@ -67,6 +67,8 @@ oneway interface IInCallAdapter { void swapConference(String callId); + void addConferenceParticipants(String callId, in List participants); + void turnOnProximitySensor(); void turnOffProximitySensor(boolean screenOnImmediately); diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 382313304611b..f89d1da6b9d97 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -1088,6 +1088,13 @@ public class CarrierConfigManager { public static final String KEY_SUPPORT_ADHOC_CONFERENCE_CALLS_BOOL = "support_adhoc_conference_calls_bool"; + /** + * Determines whether conference participants can be added to existing call. When {@code true}, + * adding conference participants to existing call is supported, {@code false otherwise}. + */ + public static final String KEY_SUPPORT_ADD_CONFERENCE_PARTICIPANTS_BOOL = + "support_add_conference_participants_bool"; + /** * Determines whether conference calls are supported by a carrier. When {@code true}, * conference calling is supported, {@code false otherwise}. @@ -3571,6 +3578,7 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_IGNORE_RTT_MODE_SETTING_BOOL, false); sDefaults.putInt(KEY_CDMA_3WAYCALL_FLASH_DELAY_INT , 0); sDefaults.putBoolean(KEY_SUPPORT_ADHOC_CONFERENCE_CALLS_BOOL, false); + sDefaults.putBoolean(KEY_SUPPORT_ADD_CONFERENCE_PARTICIPANTS_BOOL, false); sDefaults.putBoolean(KEY_SUPPORT_CONFERENCE_CALL_BOOL, true); sDefaults.putBoolean(KEY_SUPPORT_IMS_CONFERENCE_CALL_BOOL, true); sDefaults.putBoolean(KEY_SUPPORT_MANAGE_IMS_CONFERENCE_CALL_BOOL, true); From 0c62ef09bb5a31b047a12a18383e2461649404e9 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Tue, 11 Feb 2020 14:39:43 -0800 Subject: [PATCH 2/2] Mark adhoc conference call APIs as @hide. Test: make -j update-api Test: Run unit tests Bug: 62151032 Change-Id: I8fe9c4d2c9a8861deea3a0def82c432762cd1222 --- api/current.txt | 6 ------ telecomm/java/android/telecom/Call.java | 7 ++++++- telecomm/java/android/telecom/Conference.java | 5 +++-- telecomm/java/android/telecom/Connection.java | 6 ++++-- telephony/java/android/telephony/CarrierConfigManager.java | 1 + 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/api/current.txt b/api/current.txt index 5b618ed738045..6b90fbb1c4109 100644 --- a/api/current.txt +++ b/api/current.txt @@ -43553,7 +43553,6 @@ package android.system { package android.telecom { public final class Call { - method public void addConferenceParticipants(@NonNull java.util.List); method public void answer(int); method public void conference(android.telecom.Call); method public void deflect(android.net.Uri); @@ -43662,7 +43661,6 @@ package android.telecom { method public static boolean hasProperty(int, int); method public boolean hasProperty(int); method public static String propertiesToString(int); - field public static final int CAPABILITY_ADD_PARTICIPANT = 33554432; // 0x2000000 field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 4194304; // 0x400000 field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000 field public static final int CAPABILITY_CAN_PULL_CALL = 8388608; // 0x800000 @@ -43783,7 +43781,6 @@ package android.telecom { method public final android.telecom.StatusHints getStatusHints(); method public android.telecom.Connection.VideoProvider getVideoProvider(); method public int getVideoState(); - method public void onAddConferenceParticipants(@NonNull java.util.List); method public void onCallAudioStateChanged(android.telecom.CallAudioState); method public void onConnectionAdded(android.telecom.Connection); method public void onDisconnect(); @@ -43847,7 +43844,6 @@ package android.telecom { method public final boolean isRingbackRequested(); method public final void notifyConferenceMergeFailed(); method public void onAbort(); - method public void onAddConferenceParticipants(@NonNull java.util.List); method public void onAnswer(int); method public void onAnswer(); method public void onCallAudioStateChanged(android.telecom.CallAudioState); @@ -43927,7 +43923,6 @@ package android.telecom { field public static final int AUDIO_CODEC_GSM_HR = 10; // 0xa field public static final int AUDIO_CODEC_NONE = 0; // 0x0 field public static final int AUDIO_CODEC_QCELP13K = 3; // 0x3 - field public static final int CAPABILITY_ADD_PARTICIPANT = 67108864; // 0x4000000 field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000 field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000 field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000 @@ -44901,7 +44896,6 @@ package android.telephony { field public static final String KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_bool"; field public static final String KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL = "sms_requires_destination_number_conversion_bool"; field public static final String KEY_SUPPORT_3GPP_CALL_FORWARDING_WHILE_ROAMING_BOOL = "support_3gpp_call_forwarding_while_roaming_bool"; - field public static final String KEY_SUPPORT_ADD_CONFERENCE_PARTICIPANTS_BOOL = "support_add_conference_participants_bool"; field public static final String KEY_SUPPORT_CLIR_NETWORK_DEFAULT_BOOL = "support_clir_network_default_bool"; field public static final String KEY_SUPPORT_CONFERENCE_CALL_BOOL = "support_conference_call_bool"; field public static final String KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL = "support_emergency_sms_over_ims_bool"; diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index ecb2e003007a9..cd304b31af0d2 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -459,7 +459,11 @@ public final class Call { /** Call supports the deflect feature. */ public static final int CAPABILITY_SUPPORT_DEFLECT = 0x01000000; - /** call supports adding participants to existing call */ + /** + * Call supports adding participants to the call via + * {@link #addConferenceParticipants(List)}. + * @hide + */ public static final int CAPABILITY_ADD_PARTICIPANT = 0x02000000; //****************************************************************************************** // Next CAPABILITY value: 0x04000000 @@ -1713,6 +1717,7 @@ public final class Call { * See {@link Details#CAPABILITY_ADD_PARTICIPANT}. * * @param participants participants to be pulled to existing call. + * @hide */ public void addConferenceParticipants(@NonNull List participants) { mInCallAdapter.addConferenceParticipants(mTelecomCallId, participants); diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index 1b6b1eab58404..c32b37416d694 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -319,8 +319,9 @@ public abstract class Conference extends Conferenceable { public void onConnectionAdded(Connection connection) {} /** - * Notifies the {@link Conference} of a request to add a new participant to the conference call - * @param participants that will be added to existing conference call + * Notifies the {@link Conference} of a request to add a new participants to the conference call + * @param participants that will be added to this conference call + * @hide */ public void onAddConferenceParticipants(@NonNull List participants) {} diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index f974be5d9a411..48ed6ae511398 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -378,7 +378,8 @@ public abstract class Connection extends Conferenceable { /** * When set, indicates that this {@link Connection} supports initiation of a conference call - * by directly adding a participant using {@link #onAddConferenceParticipants()}. + * by directly adding participants using {@link #onAddConferenceParticipants(List)}. + * @hide */ public static final int CAPABILITY_ADD_PARTICIPANT = 0x04000000; //********************************************************************************************** @@ -2960,9 +2961,10 @@ public abstract class Connection extends Conferenceable { public void onSeparate() {} /** - * Supports initiation of a conference call by directly adding participants. + * Supports initiation of a conference call by directly adding participants to an ongoing call. * * @param participants with which conference call will be formed. + * @hide */ public void onAddConferenceParticipants(@NonNull List participants) {} diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index f89d1da6b9d97..05a29e9524e5b 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -1091,6 +1091,7 @@ public class CarrierConfigManager { /** * Determines whether conference participants can be added to existing call. When {@code true}, * adding conference participants to existing call is supported, {@code false otherwise}. + * @hide */ public static final String KEY_SUPPORT_ADD_CONFERENCE_PARTICIPANTS_BOOL = "support_add_conference_participants_bool";