Added global retry support
The retry timer suggested by the network will persist accross network requests. Also changed the retry timer to a 64-bit value to be consistent with types used in Android time APIs. Test: FrameworksTelephonytests Fix: 159672248 Change-Id: I632d4dc07fb545fa04eb3aefb0ff3270ee8f6ff8
This commit is contained in:
@@ -12030,7 +12030,8 @@ package android.telephony.data {
|
|||||||
method public int getMtuV6();
|
method public int getMtuV6();
|
||||||
method @NonNull public java.util.List<java.net.InetAddress> getPcscfAddresses();
|
method @NonNull public java.util.List<java.net.InetAddress> getPcscfAddresses();
|
||||||
method public int getProtocolType();
|
method public int getProtocolType();
|
||||||
method public int getSuggestedRetryTime();
|
method public long getRetryIntervalMillis();
|
||||||
|
method @Deprecated public int getSuggestedRetryTime();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
|
||||||
field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; // 0x1
|
field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; // 0x1
|
||||||
@@ -12042,6 +12043,7 @@ package android.telephony.data {
|
|||||||
field public static final int LINK_STATUS_DORMANT = 1; // 0x1
|
field public static final int LINK_STATUS_DORMANT = 1; // 0x1
|
||||||
field public static final int LINK_STATUS_INACTIVE = 0; // 0x0
|
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 LINK_STATUS_UNKNOWN = -1; // 0xffffffff
|
||||||
|
field public static final int RETRY_INTERVAL_UNDEFINED = -1; // 0xffffffff
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class DataCallResponse.Builder {
|
public static final class DataCallResponse.Builder {
|
||||||
@@ -12060,7 +12062,8 @@ package android.telephony.data {
|
|||||||
method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV6(int);
|
method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV6(int);
|
||||||
method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List<java.net.InetAddress>);
|
method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List<java.net.InetAddress>);
|
||||||
method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
|
method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
|
||||||
method @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
|
method @NonNull public android.telephony.data.DataCallResponse.Builder setRetryIntervalMillis(long);
|
||||||
|
method @Deprecated @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class DataProfile implements android.os.Parcelable {
|
public final class DataProfile implements android.os.Parcelable {
|
||||||
|
|||||||
@@ -10885,7 +10885,8 @@ package android.telephony.data {
|
|||||||
method public int getMtuV6();
|
method public int getMtuV6();
|
||||||
method @NonNull public java.util.List<java.net.InetAddress> getPcscfAddresses();
|
method @NonNull public java.util.List<java.net.InetAddress> getPcscfAddresses();
|
||||||
method public int getProtocolType();
|
method public int getProtocolType();
|
||||||
method public int getSuggestedRetryTime();
|
method public long getRetryIntervalMillis();
|
||||||
|
method @Deprecated public int getSuggestedRetryTime();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
|
||||||
field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; // 0x1
|
field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; // 0x1
|
||||||
@@ -10897,6 +10898,7 @@ package android.telephony.data {
|
|||||||
field public static final int LINK_STATUS_DORMANT = 1; // 0x1
|
field public static final int LINK_STATUS_DORMANT = 1; // 0x1
|
||||||
field public static final int LINK_STATUS_INACTIVE = 0; // 0x0
|
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 LINK_STATUS_UNKNOWN = -1; // 0xffffffff
|
||||||
|
field public static final int RETRY_INTERVAL_UNDEFINED = -1; // 0xffffffff
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class DataCallResponse.Builder {
|
public static final class DataCallResponse.Builder {
|
||||||
@@ -10915,7 +10917,8 @@ package android.telephony.data {
|
|||||||
method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV6(int);
|
method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV6(int);
|
||||||
method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List<java.net.InetAddress>);
|
method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List<java.net.InetAddress>);
|
||||||
method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
|
method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
|
||||||
method @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
|
method @NonNull public android.telephony.data.DataCallResponse.Builder setRetryIntervalMillis(long);
|
||||||
|
method @Deprecated @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class DataProfile implements android.os.Parcelable {
|
public final class DataProfile implements android.os.Parcelable {
|
||||||
|
|||||||
@@ -109,8 +109,14 @@ public final class DataCallResponse implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3;
|
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
|
||||||
|
* perform data setup appropriately.
|
||||||
|
*/
|
||||||
|
public static final int RETRY_INTERVAL_UNDEFINED = -1;
|
||||||
|
|
||||||
private final @DataFailureCause int mCause;
|
private final @DataFailureCause int mCause;
|
||||||
private final int mSuggestedRetryTime;
|
private final long mSuggestedRetryTime;
|
||||||
private final int mId;
|
private final int mId;
|
||||||
private final @LinkStatus int mLinkStatus;
|
private final @LinkStatus int mLinkStatus;
|
||||||
private final @ProtocolType int mProtocolType;
|
private final @ProtocolType int mProtocolType;
|
||||||
@@ -172,7 +178,7 @@ public final class DataCallResponse implements Parcelable {
|
|||||||
mHandoverFailureMode = HANDOVER_FAILURE_MODE_LEGACY;
|
mHandoverFailureMode = HANDOVER_FAILURE_MODE_LEGACY;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DataCallResponse(@DataFailureCause int cause, int suggestedRetryTime, int id,
|
private DataCallResponse(@DataFailureCause int cause, long suggestedRetryTime, int id,
|
||||||
@LinkStatus int linkStatus, @ProtocolType int protocolType,
|
@LinkStatus int linkStatus, @ProtocolType int protocolType,
|
||||||
@Nullable String interfaceName, @Nullable List<LinkAddress> addresses,
|
@Nullable String interfaceName, @Nullable List<LinkAddress> addresses,
|
||||||
@Nullable List<InetAddress> dnsAddresses, @Nullable List<InetAddress> gatewayAddresses,
|
@Nullable List<InetAddress> dnsAddresses, @Nullable List<InetAddress> gatewayAddresses,
|
||||||
@@ -202,7 +208,7 @@ public final class DataCallResponse implements Parcelable {
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public DataCallResponse(Parcel source) {
|
public DataCallResponse(Parcel source) {
|
||||||
mCause = source.readInt();
|
mCause = source.readInt();
|
||||||
mSuggestedRetryTime = source.readInt();
|
mSuggestedRetryTime = source.readLong();
|
||||||
mId = source.readInt();
|
mId = source.readInt();
|
||||||
mLinkStatus = source.readInt();
|
mLinkStatus = source.readInt();
|
||||||
mProtocolType = source.readInt();
|
mProtocolType = source.readInt();
|
||||||
@@ -229,8 +235,22 @@ public final class DataCallResponse implements Parcelable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The suggested data retry time in milliseconds.
|
* @return The suggested data retry time in milliseconds.
|
||||||
|
*
|
||||||
|
* @deprecated Use {@link #getRetryIntervalMillis()} instead.
|
||||||
*/
|
*/
|
||||||
public int getSuggestedRetryTime() { return mSuggestedRetryTime; }
|
@Deprecated
|
||||||
|
public int getSuggestedRetryTime() {
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
public long getRetryIntervalMillis() {
|
||||||
|
return mSuggestedRetryTime;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The unique id of the data connection.
|
* @return The unique id of the data connection.
|
||||||
@@ -382,7 +402,7 @@ public final class DataCallResponse implements Parcelable {
|
|||||||
@Override
|
@Override
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
dest.writeInt(mCause);
|
dest.writeInt(mCause);
|
||||||
dest.writeInt(mSuggestedRetryTime);
|
dest.writeLong(mSuggestedRetryTime);
|
||||||
dest.writeInt(mId);
|
dest.writeInt(mId);
|
||||||
dest.writeInt(mLinkStatus);
|
dest.writeInt(mLinkStatus);
|
||||||
dest.writeInt(mProtocolType);
|
dest.writeInt(mProtocolType);
|
||||||
@@ -446,7 +466,7 @@ public final class DataCallResponse implements Parcelable {
|
|||||||
public static final class Builder {
|
public static final class Builder {
|
||||||
private @DataFailureCause int mCause;
|
private @DataFailureCause int mCause;
|
||||||
|
|
||||||
private int mSuggestedRetryTime;
|
private long mSuggestedRetryTime = RETRY_INTERVAL_UNDEFINED;
|
||||||
|
|
||||||
private int mId;
|
private int mId;
|
||||||
|
|
||||||
@@ -494,9 +514,23 @@ public final class DataCallResponse implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @param suggestedRetryTime The suggested data retry time in milliseconds.
|
* @param suggestedRetryTime The suggested data retry time in milliseconds.
|
||||||
* @return The same instance of the builder.
|
* @return The same instance of the builder.
|
||||||
|
*
|
||||||
|
* @deprecated Use {@link #setRetryIntervalMillis(long)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public @NonNull Builder setSuggestedRetryTime(int suggestedRetryTime) {
|
public @NonNull Builder setSuggestedRetryTime(int suggestedRetryTime) {
|
||||||
mSuggestedRetryTime = suggestedRetryTime;
|
mSuggestedRetryTime = (long) suggestedRetryTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the network suggested data retry interval.
|
||||||
|
*
|
||||||
|
* @param retryIntervalMillis The suggested data retry interval in milliseconds.
|
||||||
|
* @return The same instance of the builder.
|
||||||
|
*/
|
||||||
|
public @NonNull Builder setRetryIntervalMillis(long retryIntervalMillis) {
|
||||||
|
mSuggestedRetryTime = retryIntervalMillis;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user