diff --git a/CHANGELOG.md b/CHANGELOG.md index e427849be..dd9134bd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/sdk/src/main/java/ly/count/android/sdk/DeviceInfo.java b/sdk/src/main/java/ly/count/android/sdk/DeviceInfo.java index ac7d35f8e..29e2b08e6 100644 --- a/sdk/src/main/java/ly/count/android/sdk/DeviceInfo.java +++ b/sdk/src/main/java/ly/count/android/sdk/DeviceInfo.java @@ -674,32 +674,6 @@ String getMetrics(@NonNull final Context context, @Nullable final Map metricOverride) { - Map 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 */ diff --git a/sdk/src/main/java/ly/count/android/sdk/ModuleHealthCheck.java b/sdk/src/main/java/ly/count/android/sdk/ModuleHealthCheck.java index f44a8f261..f587cfd04 100644 --- a/sdk/src/main/java/ly/count/android/sdk/ModuleHealthCheck.java +++ b/sdk/src/main/java/ly/count/android/sdk/ModuleHealthCheck.java @@ -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();