Skip to content

Commit 57f83b9

Browse files
committed
fix(networking): Set MAX_EVENTS_PER_API_CALL to 5000 for API level <=17.
1 parent 97a1311 commit 57f83b9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

AndroidSDK/src/com/leanplum/internal/Request.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.content.Context;
2525
import android.content.SharedPreferences;
2626
import android.os.AsyncTask;
27+
import android.os.Build;
2728
import android.support.annotation.NonNull;
2829

2930
import com.leanplum.Leanplum;
@@ -57,7 +58,7 @@ public class Request {
5758
private static final long DEVELOPMENT_MIN_DELAY_MS = 100;
5859
private static final long DEVELOPMENT_MAX_DELAY_MS = 5000;
5960
private static final long PRODUCTION_DELAY = 60000;
60-
static final int MAX_EVENTS_PER_API_CALL = 10000;
61+
static final int MAX_EVENTS_PER_API_CALL;
6162
static final String LEANPLUM = "__leanplum__";
6263
static final String UUID_KEY = "uuid";
6364

@@ -93,6 +94,14 @@ public class Request {
9394

9495
private static List<Map<String, Object>> localErrors = new ArrayList<>();
9596

97+
static {
98+
if (Build.VERSION.SDK_INT <= 17) {
99+
MAX_EVENTS_PER_API_CALL = 5000;
100+
} else {
101+
MAX_EVENTS_PER_API_CALL = 10000;
102+
}
103+
}
104+
96105
public static void setAppId(String appId, String accessKey) {
97106
Request.appId = appId;
98107
Request.accessKey = accessKey;

0 commit comments

Comments
 (0)