DO NOT MERGE Add KEY_USE_RCS_PRESENCE_BOOL carrier config option.

- New carrier config option is used to determine if presence is used
to determine whether a contact is capable of video calling.
- Also, improve logging for PhoneAccount capabilities.

Bug: 20257833
Change-Id: Ifcc7df95677eb4399f08eb8849c4004892957e90
This commit is contained in:
Tyler Gunn
2016-03-14 16:06:11 -07:00
parent b3e1083ff0
commit 3d09db6f7a
3 changed files with 58 additions and 1 deletions

View File

@@ -32927,6 +32927,7 @@ package android.telephony {
field public static final java.lang.String KEY_SUPPORT_SWAP_AFTER_MERGE_BOOL = "support_swap_after_merge_bool";
field public static final java.lang.String KEY_USE_HFA_FOR_PROVISIONING_BOOL = "use_hfa_for_provisioning_bool";
field public static final java.lang.String KEY_USE_OTASP_FOR_PROVISIONING_BOOL = "use_otasp_for_provisioning_bool";
field public static final java.lang.String KEY_USE_RCS_PRESENCE_BOOL = "use_rcs_presence_bool";
field public static final java.lang.String KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL = "voicemail_notification_persistent_bool";
field public static final java.lang.String KEY_VOICE_PRIVACY_DISABLE_UI_BOOL = "voice_privacy_disable_ui_bool";
field public static final java.lang.String KEY_VOLTE_REPLACEMENT_RAT_INT = "volte_replacement_rat_int";

View File

@@ -626,7 +626,7 @@ public final class PhoneAccount implements Parcelable {
.append("] PhoneAccount: ")
.append(mAccountHandle)
.append(" Capabilities: ")
.append(mCapabilities)
.append(capabilitiesToString(mCapabilities))
.append(" Schemes: ");
for (String scheme : mSupportedUriSchemes) {
sb.append(scheme)
@@ -635,4 +635,42 @@ public final class PhoneAccount implements Parcelable {
sb.append("]");
return sb.toString();
}
/**
* Generates a string representation of a capabilities bitmask.
*
* @param capabilities The capabilities bitmask.
* @return String representation of the capabilities bitmask.
*/
private String capabilitiesToString(int capabilities) {
StringBuilder sb = new StringBuilder();
if (hasCapabilities(CAPABILITY_VIDEO_CALLING)) {
sb.append("Video ");
}
if (hasCapabilities(CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE)) {
sb.append("Presence ");
}
if (hasCapabilities(CAPABILITY_CALL_PROVIDER)) {
sb.append("CallProvider ");
}
if (hasCapabilities(CAPABILITY_CALL_SUBJECT)) {
sb.append("CallSubject ");
}
if (hasCapabilities(CAPABILITY_CONNECTION_MANAGER)) {
sb.append("ConnectionMgr ");
}
if (hasCapabilities(CAPABILITY_EMERGENCY_CALLS_ONLY)) {
sb.append("EmergOnly ");
}
if (hasCapabilities(CAPABILITY_MULTI_USER)) {
sb.append("MultiUser ");
}
if (hasCapabilities(CAPABILITY_PLACE_EMERGENCY_CALLS)) {
sb.append("PlaceEmerg ");
}
if (hasCapabilities(CAPABILITY_SIM_SUBSCRIPTION)) {
sb.append("SimSub ");
}
return sb.toString();
}
}

View File

@@ -558,6 +558,23 @@ public class CarrierConfigManager {
public static final String BOOL_ALLOW_VIDEO_PAUSE =
"bool_allow_video_pause";
/**
* Flag indicating whether the carrier supports RCS presence indication for video calls. When
* {@code true}, the carrier supports RCS presence indication for video calls. When presence
* is supported, the device should use the
* {@link android.provider.ContactsContract.Data#CARRIER_PRESENCE} bit mask and set the
* {@link android.provider.ContactsContract.Data#CARRIER_PRESENCE_VT_CAPABLE} bit to indicate
* whether each contact supports video calling. The UI is made aware that presence is enabled
* via {@link android.telecom.PhoneAccount#CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE}
* and can choose to hide or show the video calling icon based on whether a contact supports
* video.
*
* @hide
*/
@SystemApi
public static final String KEY_USE_RCS_PRESENCE_BOOL = "use_rcs_presence_bool";
/** The default value for every variable. */
private final static PersistableBundle sDefaults;
@@ -672,6 +689,7 @@ public class CarrierConfigManager {
sDefaults.putString(KEY_MMS_UA_PROF_URL_STRING, "");
sDefaults.putString(KEY_MMS_USER_AGENT_STRING, "");
sDefaults.putBoolean(KEY_ALLOW_NON_EMERGENCY_CALLS_IN_ECM_BOOL, true);
sDefaults.putBoolean(KEY_USE_RCS_PRESENCE_BOOL, false);
}
/**