diff --git a/core/api/current.txt b/core/api/current.txt index 2d9e36a4bd45..3a8076c932b7 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -39980,6 +39980,7 @@ package android.telephony { field public static final String KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL = "ims.rcs_bulk_capability_exchange_bool"; field public static final String KEY_RCS_FEATURE_TAG_ALLOWED_STRING_ARRAY = "ims.rcs_feature_tag_allowed_string_array"; field public static final String KEY_RCS_REQUIRES_PROVISIONING_BUNDLE = "ims.rcs_requires_provisioning_bundle"; + field public static final String KEY_USE_SIP_URI_FOR_PRESENCE_SUBSCRIBE_BOOL = "ims.use_sip_uri_for_presence_subscribe_bool"; field public static final String KEY_WIFI_OFF_DEFERRING_TIME_MILLIS_INT = "ims.wifi_off_deferring_time_millis_int"; } diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 83a7215e5c23..2c7f456c5e76 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -13241,6 +13241,7 @@ package android.telephony.ims { method @Nullable public android.telephony.ims.RcsContactPresenceTuple getCapabilityTuple(@NonNull String); method @NonNull public java.util.List getCapabilityTuples(); method @NonNull public android.net.Uri getContactUri(); + method @Nullable public android.net.Uri getEntityUri(); method @NonNull public java.util.Set getFeatureTags(); method public int getRequestResult(); method public int getSourceType(); @@ -13269,6 +13270,7 @@ package android.telephony.ims { method @NonNull public android.telephony.ims.RcsContactUceCapability.PresenceBuilder addCapabilityTuple(@NonNull android.telephony.ims.RcsContactPresenceTuple); method @NonNull public android.telephony.ims.RcsContactUceCapability.PresenceBuilder addCapabilityTuples(@NonNull java.util.List); method @NonNull public android.telephony.ims.RcsContactUceCapability build(); + method @NonNull public android.telephony.ims.RcsContactUceCapability.PresenceBuilder setEntityUri(@NonNull android.net.Uri); } public class RcsUceAdapter { diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 2918f89098e0..047207f2b764 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -4618,6 +4618,15 @@ public class CarrierConfigManager { public static final String KEY_ENABLE_PRESENCE_GROUP_SUBSCRIBE_BOOL = KEY_PREFIX + "enable_presence_group_subscribe_bool"; + /** + * Flag indicating whether or not to use SIP URI when send a presence subscribe. + * When {@code true}, the device sets the To and Contact header to be SIP URI using + * the TelephonyManager#getIsimDomain" API. + * If {@code false}, the device uses a TEL URI. + */ + public static final String KEY_USE_SIP_URI_FOR_PRESENCE_SUBSCRIBE_BOOL = + KEY_PREFIX + "use_sip_uri_for_presence_subscribe_bool"; + /** * An integer key associated with the period of time in seconds the non-rcs capability * information of each contact is cached on the device. @@ -4800,6 +4809,7 @@ public class CarrierConfigManager { defaults.putBoolean(KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL, false); defaults.putBoolean(KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL, false); defaults.putBoolean(KEY_ENABLE_PRESENCE_GROUP_SUBSCRIBE_BOOL, false); + defaults.putBoolean(KEY_USE_SIP_URI_FOR_PRESENCE_SUBSCRIBE_BOOL, false); defaults.putInt(KEY_NON_RCS_CAPABILITIES_CACHE_EXPIRATION_SEC_INT, 30 * 24 * 60 * 60); defaults.putBoolean(KEY_RCS_REQUEST_FORBIDDEN_BY_SIP_489_BOOL, false); defaults.putLong(KEY_RCS_REQUEST_RETRY_INTERVAL_MILLIS_LONG, 20 * 60 * 1000); diff --git a/telephony/java/android/telephony/ims/RcsContactUceCapability.java b/telephony/java/android/telephony/ims/RcsContactUceCapability.java index 91121187a19a..9c36db8176b9 100644 --- a/telephony/java/android/telephony/ims/RcsContactUceCapability.java +++ b/telephony/java/android/telephony/ims/RcsContactUceCapability.java @@ -220,6 +220,15 @@ public final class RcsContactUceCapability implements Parcelable { return this; } + /** + * Set the entity URI related to the contact whose capabilities were requested. + * @param entityUri the 'pres' URL of the PRESENTITY publishing presence document. + */ + public @NonNull PresenceBuilder setEntityUri(@NonNull Uri entityUri) { + mCapabilities.mEntityUri = entityUri; + return this; + } + /** * @return the RcsContactUceCapability instance. */ @@ -232,6 +241,7 @@ public final class RcsContactUceCapability implements Parcelable { private @SourceType int mSourceType; private @CapabilityMechanism int mCapabilityMechanism; private @RequestResult int mRequestResult; + private Uri mEntityUri; private final Set mFeatureTags = new HashSet<>(); private final List mPresenceTuples = new ArrayList<>(); @@ -248,6 +258,7 @@ public final class RcsContactUceCapability implements Parcelable { mCapabilityMechanism = in.readInt(); mSourceType = in.readInt(); mRequestResult = in.readInt(); + mEntityUri = in.readParcelable(Uri.class.getClassLoader(), android.net.Uri.class); List featureTagList = new ArrayList<>(); in.readStringList(featureTagList); mFeatureTags.addAll(featureTagList); @@ -260,6 +271,7 @@ public final class RcsContactUceCapability implements Parcelable { out.writeInt(mCapabilityMechanism); out.writeInt(mSourceType); out.writeInt(mRequestResult); + out.writeParcelable(mEntityUri, flags); out.writeStringList(new ArrayList<>(mFeatureTags)); out.writeParcelableList(mPresenceTuples, flags); } @@ -361,6 +373,15 @@ public final class RcsContactUceCapability implements Parcelable { return mContactUri; } + /** + * Retrieve the entity URI of the contact whose presence information is being requested for. + * @return the URI representing the 'pres' URL of the PRESENTITY publishing presence document + * or {@code null} if the entity uri does not exist in the presence document. + */ + public @Nullable Uri getEntityUri() { + return mEntityUri; + } + @Override public String toString() { StringBuilder builder = new StringBuilder("RcsContactUceCapability"); @@ -382,6 +403,13 @@ public final class RcsContactUceCapability implements Parcelable { builder.append(mSourceType); builder.append(", requestResult="); builder.append(mRequestResult); + if (Build.IS_ENG) { + builder.append("entity uri="); + builder.append(mEntityUri != null ? mEntityUri : "null"); + } else { + builder.append("entity uri (isNull)="); + builder.append(mEntityUri != null ? "XXX" : "null"); + } if (mCapabilityMechanism == CAPABILITY_MECHANISM_PRESENCE) { builder.append(", presenceTuples={");