From fbed2b4511f543aa9c3a621e726e2068de375659 Mon Sep 17 00:00:00 2001 From: Gabriele Svelto Date: Wed, 11 Apr 2018 21:29:14 +0200 Subject: [PATCH] Bug 1453238 - Populate the crash ping platformVersion and displayVersion fields correctly on Fennec; r=jchen MozReview-Commit-ID: 6VK40Hoz1kX --HG-- extra : rebase_source : 01a2a65de62d0ad04db85e7554ab8d8ea86006de --- .../pingbuilders/TelemetryCrashPingBuilder.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryCrashPingBuilder.java b/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryCrashPingBuilder.java index b2f04e3f1777..2f19fadb66c9 100644 --- a/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryCrashPingBuilder.java +++ b/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryCrashPingBuilder.java @@ -80,6 +80,8 @@ public class TelemetryCrashPingBuilder extends TelemetryPingBuilder { // Parse the telemetry environment and extract relevant fields from it ExtendedJSONObject env = null; String architecture = null; + String displayVersion = null; + String platformVersion = null; String xpcomAbi = null; try { @@ -88,6 +90,8 @@ public class TelemetryCrashPingBuilder extends TelemetryPingBuilder { if (build != null) { architecture = build.getString("architecture"); + displayVersion = build.getString("displayVersion"); + platformVersion = build.getString("platformVersion"); xpcomAbi = build.getString("xpcomAbi"); } } catch (NonObjectJSONException | IOException e) { @@ -99,7 +103,8 @@ public class TelemetryCrashPingBuilder extends TelemetryPingBuilder { } payload.put("payload", createPayloadNode(crashId, annotations)); - payload.put("application", createApplicationNode(annotations, architecture, xpcomAbi)); + payload.put("application", + createApplicationNode(annotations, architecture, displayVersion, platformVersion, xpcomAbi)); } /** @@ -180,15 +185,16 @@ public class TelemetryCrashPingBuilder extends TelemetryPingBuilder { * @returns A JSON object representing the ping's application node */ private static ExtendedJSONObject createApplicationNode(HashMap annotations, - String architecture, String xpcomAbi) { + String architecture, String displayVersion, + String platformVersion, String xpcomAbi) { ExtendedJSONObject node = new ExtendedJSONObject(); final String version = annotations.get("Version"); node.put("vendor", annotations.get("Vendor")); node.put("name", annotations.get("ProductName")); node.put("buildId", annotations.get("BuildID")); - node.put("displayVersion", version); - node.put("platformVersion", version); + node.put("displayVersion", displayVersion); + node.put("platformVersion", platformVersion); node.put("version", version); node.put("channel", annotations.get("ReleaseChannel"));