File tree Expand file tree Collapse file tree
androidTest/java/ly/count/android/sdk
main/java/ly/count/android/sdk Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,6 +126,10 @@ public void setUp() {
126126 @ Override public int getBOMDuration () {
127127 return 60 ;
128128 }
129+
130+ @ Override public int getRequestTimeoutDurationMillis () {
131+ return 30_000 ;
132+ }
129133 };
130134
131135 Countly .sharedInstance ().setLoggingEnabled (true );
Original file line number Diff line number Diff line change @@ -29,4 +29,6 @@ interface ConfigurationProvider {
2929 int getBOMRequestAge ();
3030
3131 int getBOMDuration ();
32+
33+ int getRequestTimeoutDurationMillis ();
3234}
Original file line number Diff line number Diff line change @@ -204,6 +204,7 @@ public class CountlyConfig {
204204 String sdkBehaviorSettings ;
205205 boolean backOffMechanismEnabled = true ;
206206 boolean sdkBehaviorSettingsRequestsDisabled = false ;
207+ int requestTimeoutDuration = 30 ; // in seconds
207208
208209 /**
209210 * THIS VARIABLE SHOULD NOT BE USED
@@ -1034,6 +1035,23 @@ public synchronized CountlyConfig disableSDKBehaviorSettingsUpdates() {
10341035 return this ;
10351036 }
10361037
1038+ /**
1039+ * Set the request timeout duration in seconds
1040+ * Minimum value is "1" second
1041+ * Default value is "30" seconds
1042+ *
1043+ * @param requestTimeoutDuration The request timeout duration in seconds
1044+ * @return Returns the same config object for convenient linking
1045+ */
1046+ public synchronized CountlyConfig setRequestTimeoutDuration (int requestTimeoutDuration ) {
1047+ int tempRequestTimeoutDuration = requestTimeoutDuration ;
1048+ if (tempRequestTimeoutDuration <= 0 ) {
1049+ tempRequestTimeoutDuration = 1 ;
1050+ }
1051+ this .requestTimeoutDuration = tempRequestTimeoutDuration ;
1052+ return this ;
1053+ }
1054+
10371055 /**
10381056 * APM configuration interface to be used with CountlyConfig
10391057 */
Original file line number Diff line number Diff line change @@ -494,4 +494,8 @@ public boolean getTrackingEnabled() {
494494 @ Override public int getBOMDuration () {
495495 return currentVBOMDuration ;
496496 }
497+
498+ @ Override public int getRequestTimeoutDurationMillis () {
499+ return _cly .config_ .requestTimeoutDuration * 1000 ;
500+ }
497501}
You can’t perform that action at this time.
0 commit comments