One-key 4G conference and add multi-participants support
IMS: Add APIs to get intent for conference dialer
1) Add config to control the conference dialer by MCC/MNC.
3) Start confer dialer to originate a conference call.
4) Start confer dialer to add participants for the existing conference call.
5) Show 4G conference call option only if IMS is registered.
Change-Id: Ieb89e43dbd0cec13c89af332d7923d181d92b23a
IMS: Show conference participant state
1) Add config to control the conference state display.
2) Show conference participant state according to the config value.
3) Add more states for conference call.
Change-Id: I75919d0538d2990c161a393d47ceacaf7cbcf805
IMS: Implement adding multi-participants to an exsiting conference call
1) Add a config value to enable or disable of adding
multi-participants to conference call.
2) Format intent with current participants to start ConfernceDialer.
3) Config to add participant only in conferencall call for CMCC.
4) Format participants' numbers before sending add multi
participants intent to ConferenceCallActivity.
Change-Id: Ibcbfd2b26801686de2abb6f2940c97487b20b424
IMS: Enable entry 4G conference call in Dialer
1) Start conference call in dialtact.
2) Start conference call in dialpad with numbers.
3) Show 4G conference call option only if IMS is registered.
Change-Id: I9f9c379e26b904f7749a72241e51cc6660f98d53
CRs-Fixed: 934253
diff --git a/InCallUI/res/layout/caller_in_conference.xml b/InCallUI/res/layout/caller_in_conference.xml
index ac78096..dd14002 100644
--- a/InCallUI/res/layout/caller_in_conference.xml
+++ b/InCallUI/res/layout/caller_in_conference.xml
@@ -89,6 +89,15 @@
</LinearLayout>
+ <TextView android:id="@+id/conferenceCallerState"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:textSize="18sp"
+ android:ellipsize="marquee"
+ android:gravity="center_vertical"
+ android:textColor="@color/conference_call_manager_secondary_text_color"
+ android:singleLine="true"/>
+
<!-- "Separate" (i.e. "go private") button for this caller -->
<ImageView android:id="@+id/conferenceCallerSeparate"
android:src="@drawable/ic_call_split_white_24dp"
diff --git a/InCallUI/res/values-mcc460-mnc00/qticonfig.xml b/InCallUI/res/values-mcc460-mnc00/qticonfig.xml
index c0f6e217..e7389a3 100644
--- a/InCallUI/res/values-mcc460-mnc00/qticonfig.xml
+++ b/InCallUI/res/values-mcc460-mnc00/qticonfig.xml
@@ -37,4 +37,12 @@
<bool name="call_duration_enabled">false</bool>
<!-- Config to enable/disable ims call log -->
<bool name="ims_call_type_enabled">true</bool>
+ <!-- Flag indicating if conference dialer is enabled -->
+ <bool name="config_enable_conference_dialer">true</bool>
+ <!-- Config to enable/disable conference state display -->
+ <bool name="config_conference_call_show_participant_status">true</bool>
+ <!-- Config to enable/disable add multi participants -->
+ <bool name="add_multi_participants_enabled">true</bool>
+ <!-- Config to add participant only in conferencall call-->
+ <bool name="add_participant_only_in_conference">true</bool>
</resources>
diff --git a/InCallUI/res/values-mcc460-mnc02/qticonfig.xml b/InCallUI/res/values-mcc460-mnc02/qticonfig.xml
index e2ba8a9..5c88553 100644
--- a/InCallUI/res/values-mcc460-mnc02/qticonfig.xml
+++ b/InCallUI/res/values-mcc460-mnc02/qticonfig.xml
@@ -37,4 +37,12 @@
<bool name="call_duration_enabled">false</bool>
<!-- Config to enable/disable ims call log -->
<bool name="ims_call_type_enabled">true</bool>
+ <!-- Flag indicating if conference dialer is enabled -->
+ <bool name="config_enable_conference_dialer">true</bool>
+ <!-- Config to enable/disable conference state display -->
+ <bool name="config_conference_call_show_participant_status">true</bool>
+ <!-- Config to enable/disable add multi participants -->
+ <bool name="add_multi_participants_enabled">true</bool>
+ <!-- Config to add participant only in conferencall call-->
+ <bool name="add_participant_only_in_conference">true</bool>
</resources>
diff --git a/InCallUI/res/values-mcc460-mnc07/qticonfig.xml b/InCallUI/res/values-mcc460-mnc07/qticonfig.xml
index c0f6e217..e7389a3 100644
--- a/InCallUI/res/values-mcc460-mnc07/qticonfig.xml
+++ b/InCallUI/res/values-mcc460-mnc07/qticonfig.xml
@@ -37,4 +37,12 @@
<bool name="call_duration_enabled">false</bool>
<!-- Config to enable/disable ims call log -->
<bool name="ims_call_type_enabled">true</bool>
+ <!-- Flag indicating if conference dialer is enabled -->
+ <bool name="config_enable_conference_dialer">true</bool>
+ <!-- Config to enable/disable conference state display -->
+ <bool name="config_conference_call_show_participant_status">true</bool>
+ <!-- Config to enable/disable add multi participants -->
+ <bool name="add_multi_participants_enabled">true</bool>
+ <!-- Config to add participant only in conferencall call-->
+ <bool name="add_participant_only_in_conference">true</bool>
</resources>
diff --git a/InCallUI/res/values-mcc460-mnc08/qticonfig.xml b/InCallUI/res/values-mcc460-mnc08/qticonfig.xml
index c0f6e217..e7389a3 100644
--- a/InCallUI/res/values-mcc460-mnc08/qticonfig.xml
+++ b/InCallUI/res/values-mcc460-mnc08/qticonfig.xml
@@ -37,4 +37,12 @@
<bool name="call_duration_enabled">false</bool>
<!-- Config to enable/disable ims call log -->
<bool name="ims_call_type_enabled">true</bool>
+ <!-- Flag indicating if conference dialer is enabled -->
+ <bool name="config_enable_conference_dialer">true</bool>
+ <!-- Config to enable/disable conference state display -->
+ <bool name="config_conference_call_show_participant_status">true</bool>
+ <!-- Config to enable/disable add multi participants -->
+ <bool name="add_multi_participants_enabled">true</bool>
+ <!-- Config to add participant only in conferencall call-->
+ <bool name="add_participant_only_in_conference">true</bool>
</resources>
diff --git a/InCallUI/res/values/qticonfig.xml b/InCallUI/res/values/qticonfig.xml
index 259454c..f0c7342 100644
--- a/InCallUI/res/values/qticonfig.xml
+++ b/InCallUI/res/values/qticonfig.xml
@@ -44,4 +44,12 @@
<bool name="call_duration_enabled">true</bool>
<!-- Config to enable/disable ims call log -->
<bool name="ims_call_type_enabled">false</bool>
+ <!-- Flag indicating if conference dialer is enabled -->
+ <bool name="config_enable_conference_dialer">false</bool>
+ <!-- Config to enable/disable conference state display -->
+ <bool name="config_conference_call_show_participant_status">false</bool>
+ <!-- Config to enable/disable add multi participants -->
+ <bool name="add_multi_participants_enabled">false</bool>
+ <!-- Config to add participant only in conferencall call-->
+ <bool name="add_participant_only_in_conference">false</bool>
</resources>
diff --git a/InCallUI/res/values/strings.xml b/InCallUI/res/values/strings.xml
index aa92b91..7e2eb71 100644
--- a/InCallUI/res/values/strings.xml
+++ b/InCallUI/res/values/strings.xml
@@ -530,4 +530,10 @@
<string name="open_now">Open now</string>
<!-- Displayed when a place is closed. -->
<string name="closed_now">Closed now</string>
+ <string name="call_state_dialing">Dialing</string>
+ <string name="call_state_holding">Holding</string>
+ <string name="call_state_active">Active</string>
+ <string name="call_state_unknown">Unknown</string>
+ <string name="call_state_disconnecting">Disconnecting</string>
+ <string name="call_state_disconnected">Disconnected</string>
</resources>
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index d4ebc61..5ba8ab5 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -649,6 +649,10 @@
}
}
+ public int getTrueState(){
+ return mState;
+ }
+
public void setState(int state) {
mState = state;
if (mState == State.INCOMING) {
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
index 61c7a35..66f002c 100644
--- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
@@ -261,6 +261,11 @@
}
public void addParticipantClicked() {
+ if (getUi().getContext().getResources().getBoolean(
+ R.bool.add_multi_participants_enabled)){
+ InCallPresenter.getInstance().sendAddMultiParticipantsIntent();
+ return;
+ }
InCallPresenter.getInstance().sendAddParticipantIntent();
}
@@ -435,7 +440,11 @@
final boolean showDowngradeToAudio = isVideo && isDowngradeToAudioSupported(call);
final boolean showMute = call.can(android.telecom.Call.Details.CAPABILITY_MUTE);
int callTransferCapabilities = call.getTransferCapabilities();
- final boolean showAddParticipant = call.can(CAPABILITY_ADD_PARTICIPANT);
+ boolean showAddParticipant = call.can(CAPABILITY_ADD_PARTICIPANT);
+ if (ui.getContext().getResources().getBoolean(
+ R.bool.add_participant_only_in_conference)) {
+ showAddParticipant = showAddParticipant&&(call.isConferenceCall());
+ }
ui.showButton(BUTTON_AUDIO, true);
ui.showButton(BUTTON_SWAP, showSwap);
diff --git a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java
index 6fb6e5d..c995be0 100644
--- a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java
+++ b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java
@@ -126,7 +126,7 @@
}
Log.d(this, "Number of calls is " + String.valueOf(calls.size()));
-
+ Log.d(this, "update calls" + calls);
// Users can split out a call from the conference call if either the active call or the
// holding call is empty. If both are filled, users can not split out another call.
final boolean hasActiveCall = (callList.getActiveCall() != null);
diff --git a/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java b/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java
index d68ae1f..e1968f2 100644
--- a/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java
+++ b/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java
@@ -366,7 +366,7 @@
contactCache.nameAlternative, mContactsPreferences),
contactCache.number, contactCache.label,
contactCache.lookupKey, contactCache.displayPhotoUri, thisRowCanSeparate,
- thisRowCanDisconnect);
+ thisRowCanDisconnect, getResourceforState(call.getTrueState()));
// Tag the row in the conference participant list with the call id to make it easier to
// find calls when contact cache information is loaded.
@@ -375,6 +375,33 @@
return result;
}
+ private static int getResourceforState(int state){
+ int res;
+ switch (state){
+ case Call.State.ACTIVE:
+ res = R.string.call_state_active;
+ break;
+ case Call.State.NEW:
+ case Call.State.IDLE:
+ case Call.State.DIALING:
+ case Call.State.REDIALING:
+ res = R.string.call_state_dialing;
+ break;
+ case Call.State.ONHOLD:
+ res = R.string.call_state_holding;
+ break;
+ case Call.State.DISCONNECTING:
+ res = R.string.call_state_disconnecting;
+ break;
+ case Call.State.DISCONNECTED:
+ res = R.string.call_state_disconnected;
+ break;
+ default:
+ res = R.string.call_state_unknown;
+ }
+ return res;
+ }
+
/**
* Replaces the contact info for a participant and triggers a refresh of the UI.
*
@@ -404,7 +431,7 @@
*/
private final void setCallerInfoForRow(View view, String callerName, String preferredName,
String callerNumber, String callerNumberType, String lookupKey, Uri photoUri,
- boolean thisRowCanSeparate, boolean thisRowCanDisconnect) {
+ boolean thisRowCanSeparate, boolean thisRowCanDisconnect, int state) {
final ImageView photoView = (ImageView) view.findViewById(R.id.callerPhoto);
final TextView nameTextView = (TextView) view.findViewById(R.id.conferenceCallerName);
@@ -413,7 +440,11 @@
R.id.conferenceCallerNumberType);
final View endButton = view.findViewById(R.id.conferenceCallerDisconnect);
final View separateButton = view.findViewById(R.id.conferenceCallerSeparate);
-
+ if (mContext.getResources().getBoolean(R.bool.
+ config_conference_call_show_participant_status)){
+ final TextView stateTextView = (TextView) view.findViewById(R.id.conferenceCallerState);
+ stateTextView.setText(state);
+ }
endButton.setVisibility(thisRowCanDisconnect ? View.VISIBLE : View.GONE);
if (thisRowCanDisconnect) {
endButton.setOnClickListener(mDisconnectListener);
@@ -457,6 +488,7 @@
* @param conferenceParticipants The calls which make up the conference participants.
*/
private void updateParticipantInfo(List<Call> conferenceParticipants) {
+ Log.d(this, "updateParticipantInfo: " + conferenceParticipants);
final ContactInfoCache cache = ContactInfoCache.getInstance(mContext);
boolean newParticipantAdded = false;
HashSet<String> newCallIds = new HashSet<>(conferenceParticipants.size());
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 630bb94..9142a8a 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -1678,6 +1678,37 @@
}
}
+ public void sendAddMultiParticipantsIntent() {
+ Intent intent = new Intent("android.intent.action.ADDPARTICIPANT");
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.putExtra("add_participant", true);
+
+ Call call = mCallList.getActiveOrBackgroundCall();
+ List<String> childCallIdList = call.getChildCallIds();
+ if (childCallIdList != null) {
+ StringBuffer sb = new StringBuffer();
+ for (int k=0; k<childCallIdList.size(); k++) {
+ String tmp = childCallIdList.get(k);
+ String number = CallList.getInstance()
+ .getCallById(tmp).getNumber();
+ if (number.contains(";")) {
+ String[] temp = number.split(";");
+ number = temp[0];
+ }
+ sb.append(number).append(";");
+ }
+ Log.d(this, "sendAddMultiParticipantsIntent, numbers " + sb.toString());
+ intent.putExtra("current_participant_list", sb.toString());
+ } else {
+ Log.e(this, "sendAddMultiParticipantsIntent, childCallIdList null.");
+ }
+ try {
+ mContext.startActivity(intent);
+ } catch (ActivityNotFoundException e) {
+ Log.e(this, "Activity for adding calls isn't found.");
+ }
+ }
+
/**
* Retrieves the current in-call camera manager instance, creating if necessary.
*
diff --git a/res/menu/dialpad_options.xml b/res/menu/dialpad_options.xml
index 63fca07..00c0f1e 100644
--- a/res/menu/dialpad_options.xml
+++ b/res/menu/dialpad_options.xml
@@ -16,6 +16,10 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
+ android:id="@+id/menu_add_to_4g_conference_call"
+ android:title="@string/menu_add_to_4g_conference_call"
+ android:showAsAction="withText" />
+ <item
android:id="@+id/menu_2s_pause"
android:title="@string/add_2sec_pause"
android:showAsAction="withText" />
diff --git a/res/menu/dialtacts_options.xml b/res/menu/dialtacts_options.xml
index 0f068f5..a5ca720 100644
--- a/res/menu/dialtacts_options.xml
+++ b/res/menu/dialtacts_options.xml
@@ -16,6 +16,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
+ android:id="@+id/menu_4g_conference_call"
+ android:title="@string/menu_4g_conference_call" />
+ <item
android:id="@+id/menu_history"
android:icon="@drawable/ic_menu_history_lt"
android:title="@string/action_menu_call_history_description" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ba3d65d..68dd5c6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -314,6 +314,8 @@
<string name="menu_show_all_calls">Show all calls</string>
<!-- Menu items for dialpad options as part of Pause and Wait ftr [CHAR LIMIT=30] -->
+ <string name="menu_add_to_4g_conference_call">Add to 4G conference call</string>
+ <string name="menu_4g_conference_call">4G conference call</string>
<string name="add_2sec_pause">Add 2-sec pause</string>
<string name="add_wait">Add wait</string>
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 9ee74a1..c0ef056 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -272,6 +272,9 @@
menu.findItem(R.id.menu_history).setVisible(
PermissionsUtil.hasPhonePermissions(DialtactsActivity.this));
+ final MenuItem ConferDialerOption = menu.findItem(R.id.menu_4g_conference_call);
+ ConferDialerOption.setVisible(
+ IntentUtil.isConferDialerEnabled(getApplicationContext()));
super.show();
}
}
@@ -724,6 +727,9 @@
final Intent intent = new Intent(this, VoicemailArchiveActivity.class);
startActivity(intent);
return true;
+ } else if (resId == R.id.menu_4g_conference_call){
+ this.startActivity(IntentUtil.getConferenceDialerIntent(null));
+ return true;
}
return false;
}
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index f33170a..d4832ee 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -83,6 +83,7 @@
import com.android.dialer.SpeedDialUtils;
import com.android.dialer.calllog.PhoneAccountUtils;
import com.android.dialer.util.DialerUtils;
+import com.android.dialer.util.IntentUtil;
import com.android.dialer.util.IntentUtil.CallIntentBuilder;
import com.android.dialer.util.TelecomUtil;
import com.android.incallui.Call.LogState;
@@ -938,6 +939,10 @@
public void show() {
final Menu menu = getMenu();
+ final MenuItem conferDialerOption
+ = menu.findItem(R.id.menu_add_to_4g_conference_call);
+ conferDialerOption.setVisible(IntentUtil.isConferDialerEnabled(getActivity()));
+
boolean enable = !isDigitsEmpty();
for (int i = 0; i < menu.size(); i++) {
MenuItem item = menu.getItem(i);
@@ -1624,6 +1629,10 @@
CallSubjectDialog.start(getActivity(), mDigits.getText().toString());
hideAndClearDialpad(false);
return true;
+ } else if (resId == R.id.menu_add_to_4g_conference_call){
+ getActivity().startActivity(IntentUtil.getConferenceDialerIntent(
+ mDigits.getText().toString()));
+ return true;
} else {
return false;
}
diff --git a/src/com/android/dialer/util/IntentUtil.java b/src/com/android/dialer/util/IntentUtil.java
index 5a4a80b..cff261c 100644
--- a/src/com/android/dialer/util/IntentUtil.java
+++ b/src/com/android/dialer/util/IntentUtil.java
@@ -23,6 +23,9 @@
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
+import android.content.Context;
+import com.android.dialer.R;
+import android.telephony.TelephonyManager;
import com.android.contacts.common.CallUtil;
@@ -155,4 +158,36 @@
intent.putExtra(ContactsContract.Intents.Insert.PHONE_TYPE, phoneNumberType);
}
}
+ /**
+ * if true, conference dialer is enabled.
+ */
+ public static boolean isConferDialerEnabled(Context context) {
+ if (context.getResources().getBoolean(R.bool.config_enable_conference_dialer)) {
+ TelephonyManager telephonyMgr = (TelephonyManager)
+ context.getSystemService(Context.TELEPHONY_SERVICE);
+ return telephonyMgr.isImsRegistered();
+ }
+ return false;
+ }
+
+ /**
+ * get intent to start conference dialer
+ * with this intent, we can originate an conference call
+ */
+ public static Intent getConferenceDialerIntent(String number) {
+ Intent intent = new Intent("android.intent.action.ADDPARTICIPANT");
+ intent.putExtra("confernece_number_key", number);
+ return intent;
+ }
+
+ /**
+ * used to get intent to start conference dialer
+ * with this intent, we can add participants to an existing conference call
+ */
+ public static Intent getAddParticipantsIntent(String number) {
+ Intent intent = new Intent("android.intent.action.ADDPARTICIPANT");
+ intent.putExtra("add_participant", true);
+ intent.putExtra("current_participant_list", number);
+ return intent;
+ }
}