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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 25.4.4
* Improved disk size calculation in crash reports.

* Rolled back Health Check metric information to previous state.
* Mitigated an issue displaying Content on API level 35 and above.

## 25.4.3
Expand Down
26 changes: 26 additions & 0 deletions sdk/src/main/java/ly/count/android/sdk/DeviceInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,32 @@ 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.getMetrics(_cly.context_, _cly.config_.metricOverride, L);
String preparedMetrics = deviceInfo.getMetricsHealthCheck(_cly.context_, _cly.config_.metricOverride);

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