Bug 1374758 - Add 'os' object to Sync Ping bundle with basic OS information r=nalexander a=lizzard
authorGrigory Kruglov <gkruglov@mozilla.com>
Wed, 21 Jun 2017 14:27:45 -0400
changeset 414302 7648974ea04d3c71d040f84fcfc2a1c7a7def41a
parent 414301 684d28e8830de0e6549cc55c1e1d92aebbf304f2
child 414303 109e1b9998b339a3935f887383c0f2c979caf7c9
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander, lizzard
bugs1374758
milestone55.0
Bug 1374758 - Add 'os' object to Sync Ping bundle with basic OS information r=nalexander a=lizzard We'll use this both to segment pings by different platforms, and segment our dashboards by different OS versions. MozReview-Commit-ID: 9RC2jm9Ql6H
mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetrySyncPingBundleBuilder.java
--- a/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetrySyncPingBundleBuilder.java
+++ b/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetrySyncPingBundleBuilder.java
@@ -6,16 +6,17 @@
 
 package org.mozilla.gecko.telemetry.pingbuilders;
 
 import android.os.Build;
 import android.support.annotation.NonNull;
 
 import org.json.simple.JSONArray;
 import org.mozilla.gecko.AppConstants;
+import org.mozilla.gecko.Locales;
 import org.mozilla.gecko.sync.ExtendedJSONObject;
 import org.mozilla.gecko.telemetry.TelemetryOutgoingPing;
 import org.mozilla.gecko.telemetry.TelemetryPing;
 import org.mozilla.gecko.telemetry.stores.TelemetryPingStore;
 
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -82,17 +83,24 @@ public class TelemetrySyncPingBundleBuil
         application.put("platformVersion", AppConstants.MOZ_APP_VERSION);
         application.put("name", AppConstants.MOZ_APP_BASENAME);
         application.put("version", AppConstants.MOZ_APP_VERSION);
         application.put("displayVersion", AppConstants.MOZ_APP_VERSION);
         application.put("vendor", AppConstants.MOZ_APP_VENDOR);
         application.put("xpcomAbi", AppConstants.MOZ_APP_ABI);
         application.put("channel", AppConstants.MOZ_UPDATE_CHANNEL);
 
+        // Limited environment object, to help identify platforms easier. See Bug 1374758.
+        final ExtendedJSONObject os = new ExtendedJSONObject();
+        os.put("name", "Android");
+        os.put("version", Integer.toString(Build.VERSION.SDK_INT));
+        os.put("locale", Locales.getLanguageTag(Locale.getDefault()));
+
         payload.put("application", application);
+        payload.put("os", os);
 
         pingData.put("version", PING_SYNC_DATA_FORMAT_VERSION);
 
         payload.put("payload", pingData);
         return super.build();
     }
 
     @SuppressWarnings("unchecked")