Skip to content

Commit 1517ff8

Browse files
Adding improvements (missed things) (#33)
* Updating SDK versions. Fixing test bug. * Updated JSON library version from "20180813" to "20230227" * Deprecating config calls * Missed things
1 parent 1b4445d commit 1517ff8

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
- "setDeviceIdFallbackAllowed"
1414
- "overrideModule"
1515
- "getModuleOverride"
16+
- "getCrashReportingANRCheckingPeriod"
17+
- "setCrashReportingANRCheckingPeriod"
18+
- "disableANRCrashReporting"
1619
* ! Minor breaking change ! The "TestMode" functionality is being removed from the SDK.
1720
* ! Minor breaking change ! The module override functionality is being removed from the SDK.
1821
* ! Minor breaking change ! It is not possible to set the logging tag anymore.

sdk-java/src/main/java/ly/count/sdk/java/Config.java

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,6 @@ public boolean restore(byte[] data) {
385385
*/
386386
protected int sessionAutoCloseAfter = "Android".equals(System.getProperty("os.name")) ? 10 : 0;
387387

388-
/**
389-
* When not {@code null}, more than {@code 0} and {@code Feature.CrashReporting} is enabled,
390-
* Countly watches main thread for unresponsiveness.
391-
* When main thread doesn't respond for time more than this property in seconds,
392-
* SDK reports ANR crash back to Countly server.
393-
*/
394-
protected int crashReportingANRCheckingPeriod = 5;
395-
396388
/**
397389
* {@link CrashProcessor}-implementing class which is instantiated when application
398390
* crashes or crash is reported programmatically using {@link Session#addCrashReport(Throwable, boolean, String, Map, String...)}.
@@ -1110,24 +1102,19 @@ public Config addCertificatePin(String pemEncodedCertificate) {
11101102
* To disable ANR reporting, use {@link #disableANRCrashReporting()}.
11111103
*
11121104
* @param periodInSeconds how much time the SDK waits between individual ANR checks
1105+
* @deprecated will do nothing
11131106
* @return {@code this} instance for method chaining
11141107
*/
11151108
public Config setCrashReportingANRCheckingPeriod(int periodInSeconds) {
1116-
if (periodInSeconds < 0) {
1117-
System.out.print("[ConfigCore] ANR timeout less than zero doesn't make sense");
1118-
} else {
1119-
this.crashReportingANRCheckingPeriod = periodInSeconds;
1120-
}
11211109
return this;
11221110
}
11231111

11241112
/**
11251113
* Disable ANR detection and thus reporting to Countly server.
1126-
*
1114+
* @deprecated will do nothing
11271115
* @return {@code this} instance for method chaining
11281116
*/
11291117
public Config disableANRCrashReporting() {
1130-
this.crashReportingANRCheckingPeriod = 0;
11311118
return this;
11321119
}
11331120

@@ -1516,11 +1503,11 @@ public Set<String> getCertificatePins() {
15161503

15171504
/**
15181505
* Getter for {@link #crashReportingANRCheckingPeriod}
1519-
*
1506+
* @Deprecated will always return "5"
15201507
* @return {@link #crashReportingANRCheckingPeriod} value
15211508
*/
15221509
public int getCrashReportingANRCheckingPeriod() {
1523-
return crashReportingANRCheckingPeriod;
1510+
return 5;
15241511
}
15251512

15261513
/**

sdk-java/src/main/java/ly/count/sdk/java/internal/InternalConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public byte[] store() {
142142
stream.writeInt(eventsBufferSize);
143143
stream.writeInt(sessionCooldownPeriod);
144144
stream.writeBoolean(false);//for keeping backwards compatibility, remove in the future
145-
stream.writeInt(crashReportingANRCheckingPeriod);
145+
stream.writeInt(5);//for keeping backwards compatibility, remove in the future (crashReportingANRCheckingPeriod)
146146
stream.writeObject(crashProcessorClass);
147147
stream.writeInt(moduleOverrides == null ? 0 : moduleOverrides.size());
148148
if (moduleOverrides != null && moduleOverrides.size() > 0) {
@@ -231,7 +231,7 @@ public boolean restore(byte[] data) {
231231
eventsBufferSize = stream.readInt();
232232
sessionCooldownPeriod = stream.readInt();
233233
boolean throwawayCountlyTestMode = stream.readBoolean();//we are only reading this for backwards compatibility. Throw away in the future
234-
crashReportingANRCheckingPeriod = stream.readInt();
234+
int throwawayCrashReportingANRCheckingPeriod = stream.readInt();//we are only reading this for backwards compatibility. Throw away in the future. crashReportingANRCheckingPeriod
235235
crashProcessorClass = (String) stream.readObject();
236236

237237
l = stream.readInt();

0 commit comments

Comments
 (0)