Skip to content

Commit

Permalink
Adding improvements (missed things) (#33)
Browse files Browse the repository at this point in the history
* Updating SDK versions. Fixing test bug.

* Updated JSON library version from "20180813" to "20230227"

* Deprecating config calls

* Missed things
  • Loading branch information
ArtursKadikis authored Mar 6, 2023
1 parent 1b4445d commit 1517ff8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- "setDeviceIdFallbackAllowed"
- "overrideModule"
- "getModuleOverride"
- "getCrashReportingANRCheckingPeriod"
- "setCrashReportingANRCheckingPeriod"
- "disableANRCrashReporting"
* ! Minor breaking change ! The "TestMode" functionality is being removed from the SDK.
* ! Minor breaking change ! The module override functionality is being removed from the SDK.
* ! Minor breaking change ! It is not possible to set the logging tag anymore.
Expand Down
21 changes: 4 additions & 17 deletions sdk-java/src/main/java/ly/count/sdk/java/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,6 @@ public boolean restore(byte[] data) {
*/
protected int sessionAutoCloseAfter = "Android".equals(System.getProperty("os.name")) ? 10 : 0;

/**
* When not {@code null}, more than {@code 0} and {@code Feature.CrashReporting} is enabled,
* Countly watches main thread for unresponsiveness.
* When main thread doesn't respond for time more than this property in seconds,
* SDK reports ANR crash back to Countly server.
*/
protected int crashReportingANRCheckingPeriod = 5;

/**
* {@link CrashProcessor}-implementing class which is instantiated when application
* crashes or crash is reported programmatically using {@link Session#addCrashReport(Throwable, boolean, String, Map, String...)}.
Expand Down Expand Up @@ -1110,24 +1102,19 @@ public Config addCertificatePin(String pemEncodedCertificate) {
* To disable ANR reporting, use {@link #disableANRCrashReporting()}.
*
* @param periodInSeconds how much time the SDK waits between individual ANR checks
* @deprecated will do nothing
* @return {@code this} instance for method chaining
*/
public Config setCrashReportingANRCheckingPeriod(int periodInSeconds) {
if (periodInSeconds < 0) {
System.out.print("[ConfigCore] ANR timeout less than zero doesn't make sense");
} else {
this.crashReportingANRCheckingPeriod = periodInSeconds;
}
return this;
}

/**
* Disable ANR detection and thus reporting to Countly server.
*
* @deprecated will do nothing
* @return {@code this} instance for method chaining
*/
public Config disableANRCrashReporting() {
this.crashReportingANRCheckingPeriod = 0;
return this;
}

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

/**
* Getter for {@link #crashReportingANRCheckingPeriod}
*
* @Deprecated will always return "5"
* @return {@link #crashReportingANRCheckingPeriod} value
*/
public int getCrashReportingANRCheckingPeriod() {
return crashReportingANRCheckingPeriod;
return 5;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public byte[] store() {
stream.writeInt(eventsBufferSize);
stream.writeInt(sessionCooldownPeriod);
stream.writeBoolean(false);//for keeping backwards compatibility, remove in the future
stream.writeInt(crashReportingANRCheckingPeriod);
stream.writeInt(5);//for keeping backwards compatibility, remove in the future (crashReportingANRCheckingPeriod)
stream.writeObject(crashProcessorClass);
stream.writeInt(moduleOverrides == null ? 0 : moduleOverrides.size());
if (moduleOverrides != null && moduleOverrides.size() > 0) {
Expand Down Expand Up @@ -231,7 +231,7 @@ public boolean restore(byte[] data) {
eventsBufferSize = stream.readInt();
sessionCooldownPeriod = stream.readInt();
boolean throwawayCountlyTestMode = stream.readBoolean();//we are only reading this for backwards compatibility. Throw away in the future
crashReportingANRCheckingPeriod = stream.readInt();
int throwawayCrashReportingANRCheckingPeriod = stream.readInt();//we are only reading this for backwards compatibility. Throw away in the future. crashReportingANRCheckingPeriod
crashProcessorClass = (String) stream.readObject();

l = stream.readInt();
Expand Down

0 comments on commit 1517ff8

Please sign in to comment.