Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## XX.XX.XX

* Health check requests now include additional metrics.

* Mitigated an issue where behavior settings were not stored when only provided through configuration during initialization.
* Mitigated an issue where, on the first run of the SDK, behavior settings returned null if none were previously stored.
* Mitigated an issue where first behavior settings update calls sent twice.


## 25.4.2
* Mitigated an issue where latest fetched behavior settings were replacing the current settings instead of merging.

Expand Down
26 changes: 0 additions & 26 deletions sdk/src/main/java/ly/count/android/sdk/DeviceInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -674,32 +674,6 @@ String getMetrics(@NonNull final Context context, @Nullable final Map<String, St
return result;
}

@NonNull
String getMetricsHealthCheck(@NonNull final Context context, @Nullable final Map<String, String> metricOverride) {
Map<String, Object> metrics = new ConcurrentHashMap<>();

String appVersion = mp.getAppVersion(context);

if (metricOverride != null) {
if (metricOverride.containsKey("_app_version")) {
appVersion = metricOverride.get("_app_version");
}
}

metrics.put("_app_version", appVersion);

String result = new JSONObject(metrics).toString();

try {
result = java.net.URLEncoder.encode(result, "UTF-8");
} catch (UnsupportedEncodingException ex) {
// should never happen because Android guarantees UTF-8 support
Countly.sharedInstance().L.e("[getMetrics] encode failed, [" + ex + "]");
}

return result;
}

/**
* Returns a JSON object containing the device crash report
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void sendHealthCheck() {

healthCheckSent = true;

String preparedMetrics = deviceInfo.getMetricsHealthCheck(_cly.context_, _cly.config_.metricOverride);
String preparedMetrics = deviceInfo.getMetrics(_cly.context_, _cly.config_.metricOverride, L);

StringBuilder requestData = new StringBuilder(requestQueueProvider.prepareHealthCheckRequest(preparedMetrics));
ConnectionProcessor cp = requestQueueProvider.createConnectionProcessor();
Expand Down
Loading