Add entity uri field to Eab provider

- Add entity uri field to Eab provider.
- If the entity uri value exists in the Eab provider, it will be used as the request uri when sending a single subscription request.
- Add new API to convert input uri to sip uri when carrier config value is set to true.
Add entity uri field to Eab provider

Test: atest EabControllerTest PidfParserTest
Bug: b/195791162
Change-Id: Iade00e57e0b18be89afb4808b901455a412c687a
Merged-In: Iade00e57e0b18be89afb4808b901455a412c687a
This commit is contained in:
Hyunho 2022-01-26 06:26:40 +00:00 committed by Hyunho Shin
parent ca1c4e2fc2
commit c5c04b20a3
4 changed files with 41 additions and 0 deletions

View File

@ -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";
}

View File

@ -13258,6 +13258,7 @@ package android.telephony.ims {
method @Nullable public android.telephony.ims.RcsContactPresenceTuple getCapabilityTuple(@NonNull String);
method @NonNull public java.util.List<android.telephony.ims.RcsContactPresenceTuple> getCapabilityTuples();
method @NonNull public android.net.Uri getContactUri();
method @Nullable public android.net.Uri getEntityUri();
method @NonNull public java.util.Set<java.lang.String> 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<android.telephony.ims.RcsContactPresenceTuple>);
method @NonNull public android.telephony.ims.RcsContactUceCapability build();
method @NonNull public android.telephony.ims.RcsContactUceCapability.PresenceBuilder setEntityUri(@NonNull android.net.Uri);
}
public class RcsUceAdapter {

View File

@ -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);

View File

@ -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<String> mFeatureTags = new HashSet<>();
private final List<RcsContactPresenceTuple> 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<String> 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={");