Update retry time on default error policy
Change the retry time to scale exponentially (until 1 hrs) to prevent frequent retries on persistent failures.
Config short retry time for the first few attempts to deal with temporary failures.
Bug: 271218645
Test: atest IwlanTests
Change-Id: If01cb1fcd7d0247e030032b38cf40359f6d8b0e9
diff --git a/assets/defaultiwlanerrorconfig.json b/assets/defaultiwlanerrorconfig.json
index 7dd5818..ae2279a 100644
--- a/assets/defaultiwlanerrorconfig.json
+++ b/assets/defaultiwlanerrorconfig.json
@@ -64,19 +64,19 @@
{
"ErrorType": "*",
"ErrorDetails": ["*"],
- "RetryArray": ["5", "10", "-1"],
+ "RetryArray": ["1", "2", "2", "10", "20", "40", "80", "160", "320", "640", "1280", "1800", "3600", "-1"],
"UnthrottlingEvents": ["APM_ENABLE_EVENT", "APM_DISABLE_EVENT", "WIFI_DISABLE_EVENT", "WIFI_AP_CHANGED_EVENT"]
},
{
"ErrorType": "GENERIC_ERROR_TYPE",
"ErrorDetails": ["IO_EXCEPTION"],
- "RetryArray": ["0", "0", "0", "60+r15", "120", "-1"],
+ "RetryArray": ["0", "0", "0", "30", "60+r15", "120", "-1"],
"UnthrottlingEvents": ["APM_ENABLE_EVENT", "APM_DISABLE_EVENT", "WIFI_DISABLE_EVENT", "WIFI_AP_CHANGED_EVENT"]
},
{
"ErrorType": "IKE_PROTOCOL_ERROR_TYPE",
- "ErrorDetails": ["24", "9002"],
- "RetryArray": ["10", "20", "40", "80", "160"],
+ "ErrorDetails": ["*"],
+ "RetryArray": ["5", "10", "10", "20", "40", "80", "160", "320", "640", "1280", "1800", "3600", "-1"],
"UnthrottlingEvents": ["APM_ENABLE_EVENT", "WIFI_DISABLE_EVENT", "WIFI_CALLING_DISABLE_EVENT"]
}
]
diff --git a/test/com/google/android/iwlan/ErrorPolicyManagerTest.java b/test/com/google/android/iwlan/ErrorPolicyManagerTest.java
index a4539e5..c4dd6da 100644
--- a/test/com/google/android/iwlan/ErrorPolicyManagerTest.java
+++ b/test/com/google/android/iwlan/ErrorPolicyManagerTest.java
@@ -195,7 +195,7 @@
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(10, time);
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
- assertEquals(10, time);
+ assertEquals(20, time);
}
@Test
@@ -228,6 +228,10 @@
// parsing (or lack of explicit carrier-defined policy).
IwlanError iwlanError = buildIwlanIkeAuthFailedError();
long time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
+ assertEquals(5, time);
+ time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
+ assertEquals(10, time);
+ time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(10, time);
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(20, time);
@@ -235,13 +239,13 @@
assertEquals(40, time);
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(80, time);
- time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
- assertEquals(160, time);
- time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
- assertEquals(86400, time);
iwlanError = buildIwlanIkeProtocolError(9002);
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
+ assertEquals(5, time);
+ time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
+ assertEquals(10, time);
+ time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(10, time);
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(20, time);
@@ -249,10 +253,6 @@
assertEquals(40, time);
time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
assertEquals(80, time);
- time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
- assertEquals(160, time);
- time = mErrorPolicyManager.reportIwlanError(apn, iwlanError);
- assertEquals(86400, time);
}
@Test