From 133b7dc7596fb2fd0be7893eb0b4a8ba402ea78b Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Fri, 6 Nov 2020 17:11:41 -0800 Subject: [PATCH] Renamed retry interval to retry duration Fix: 171981823 Test: FrameworksTelephonyTests Merged-In: I7c4bbe0a77301761525ae793892bb811637027b5 Change-Id: I7c4bbe0a77301761525ae793892bb811637027b5 --- core/api/system-current.txt | 6 ++-- .../telephony/data/DataCallResponse.java | 33 +++++++++++-------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index cc819fa2e0787..47fbacdbde6e3 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -10510,7 +10510,7 @@ package android.telephony.data { method @NonNull public java.util.List getPcscfAddresses(); method public int getPduSessionId(); method public int getProtocolType(); - method public long getRetryIntervalMillis(); + method public long getRetryDurationMillis(); method @Deprecated public int getSuggestedRetryTime(); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; @@ -10524,7 +10524,7 @@ package android.telephony.data { field public static final int LINK_STATUS_INACTIVE = 0; // 0x0 field public static final int LINK_STATUS_UNKNOWN = -1; // 0xffffffff field public static final int PDU_SESSION_ID_NOT_SET = 0; // 0x0 - field public static final int RETRY_INTERVAL_UNDEFINED = -1; // 0xffffffff + field public static final int RETRY_DURATION_UNDEFINED = -1; // 0xffffffff } public static final class DataCallResponse.Builder { @@ -10544,7 +10544,7 @@ package android.telephony.data { method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List); method @NonNull public android.telephony.data.DataCallResponse.Builder setPduSessionId(int); method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int); - method @NonNull public android.telephony.data.DataCallResponse.Builder setRetryIntervalMillis(long); + method @NonNull public android.telephony.data.DataCallResponse.Builder setRetryDurationMillis(long); method @Deprecated @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int); } diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java index f0088b913d4ea..8348502586a5c 100644 --- a/telephony/java/android/telephony/data/DataCallResponse.java +++ b/telephony/java/android/telephony/data/DataCallResponse.java @@ -109,10 +109,10 @@ public final class DataCallResponse implements Parcelable { public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; /** - * Indicates that data retry interval is not specified. Platform can determine when to + * Indicates that data retry duration is not specified. Platform can determine when to * perform data setup appropriately. */ - public static final int RETRY_INTERVAL_UNDEFINED = -1; + public static final int RETRY_DURATION_UNDEFINED = -1; /** * Indicates that the pdu session id is not set. @@ -254,19 +254,26 @@ public final class DataCallResponse implements Parcelable { /** * @return The suggested data retry time in milliseconds. * - * @deprecated Use {@link #getRetryIntervalMillis()} instead. + * @deprecated Use {@link #getRetryDurationMillis()} instead. */ @Deprecated public int getSuggestedRetryTime() { + + // To match the pre-deprecated getSuggestedRetryTime() behavior. + if (mSuggestedRetryTime == RETRY_DURATION_UNDEFINED) { + return 0; + } else if (mSuggestedRetryTime > Integer.MAX_VALUE) { + return Integer.MAX_VALUE; + } return (int) mSuggestedRetryTime; } /** - * @return The network suggested data retry interval in milliseconds. {@code Long.MAX_VALUE} - * indicates data retry should not occur. {@link #RETRY_INTERVAL_UNDEFINED} indicates network - * did not suggest any retry interval. + * @return The network suggested data retry duration in milliseconds. {@code Long.MAX_VALUE} + * indicates data retry should not occur. {@link #RETRY_DURATION_UNDEFINED} indicates network + * did not suggest any retry duration. */ - public long getRetryIntervalMillis() { + public long getRetryDurationMillis() { return mSuggestedRetryTime; } @@ -537,7 +544,7 @@ public final class DataCallResponse implements Parcelable { public static final class Builder { private @DataFailureCause int mCause; - private long mSuggestedRetryTime = RETRY_INTERVAL_UNDEFINED; + private long mSuggestedRetryTime = RETRY_DURATION_UNDEFINED; private int mId; @@ -592,7 +599,7 @@ public final class DataCallResponse implements Parcelable { * @param suggestedRetryTime The suggested data retry time in milliseconds. * @return The same instance of the builder. * - * @deprecated Use {@link #setRetryIntervalMillis(long)} instead. + * @deprecated Use {@link #setRetryDurationMillis(long)} instead. */ @Deprecated public @NonNull Builder setSuggestedRetryTime(int suggestedRetryTime) { @@ -601,13 +608,13 @@ public final class DataCallResponse implements Parcelable { } /** - * Set the network suggested data retry interval. + * Set the network suggested data retry duration. * - * @param retryIntervalMillis The suggested data retry interval in milliseconds. + * @param retryDurationMillis The suggested data retry duration in milliseconds. * @return The same instance of the builder. */ - public @NonNull Builder setRetryIntervalMillis(long retryIntervalMillis) { - mSuggestedRetryTime = retryIntervalMillis; + public @NonNull Builder setRetryDurationMillis(long retryDurationMillis) { + mSuggestedRetryTime = retryDurationMillis; return this; }