diff --git a/core/api/current.txt b/core/api/current.txt index 235c496e999b..728a70d44824 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -40023,6 +40023,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 7d68ee1c1ad6..a64da9a7f9c8 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -13258,6 +13258,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(); @@ -13286,6 +13287,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 d7135a57aafd..04e512639852 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -4607,6 +4607,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. @@ -4750,6 +4759,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={");