Bug 1102604 - SysInfo.getLocale() is wrong. r=mcomella
authorRichard Newman <rnewman@mozilla.com>
Tue, 23 Dec 2014 14:28:46 -0800
changeset 221189 9b7ace6537733a86b1836469f3ce403eefd1a349
parent 221188 cfbcc324f038468941ec71b4145ef11b7d0d3cf3
child 221190 78614247a0b38e7e55e6e725f769a59eff71dba1
push id28013
push userphilringnalda@gmail.com
push dateWed, 24 Dec 2014 23:31:28 +0000
treeherdermozilla-central@38471b0310c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1102604
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1102604 - SysInfo.getLocale() is wrong. r=mcomella
mobile/android/base/ANRReporter.java
mobile/android/base/SysInfo.java.in
--- a/mobile/android/base/ANRReporter.java
+++ b/mobile/android/base/ANRReporter.java
@@ -10,16 +10,17 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.io.Reader;
+import java.util.Locale;
 import java.util.UUID;
 import java.util.regex.Pattern;
 
 import org.json.JSONObject;
 import org.mozilla.gecko.AppConstants.Versions;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import android.content.BroadcastReceiver;
@@ -315,17 +316,17 @@ public final class ANRReporter extends B
                 "\"version\":\"" + String.valueOf(SysInfo.getVersion()) + "\"," +
                 "\"appID\":" + JSONObject.quote(AppConstants.MOZ_APP_ID) + "," +
                 "\"appVersion\":" + JSONObject.quote(AppConstants.MOZ_APP_VERSION)+ "," +
                 "\"appName\":" + JSONObject.quote(AppConstants.MOZ_APP_BASENAME) + "," +
                 "\"appBuildID\":" + JSONObject.quote(AppConstants.MOZ_APP_BUILDID) + "," +
                 "\"appUpdateChannel\":" + JSONObject.quote(AppConstants.MOZ_UPDATE_CHANNEL) + "," +
                 // Technically the platform build ID may be different, but we'll never know
                 "\"platformBuildID\":" + JSONObject.quote(AppConstants.MOZ_APP_BUILDID) + "," +
-                "\"locale\":" + JSONObject.quote(SysInfo.getLocale()) + "," +
+                "\"locale\":" + JSONObject.quote(Locales.getLanguageTag(Locale.getDefault())) + "," +
                 "\"cpucount\":" + String.valueOf(SysInfo.getCPUCount()) + "," +
                 "\"memsize\":" + String.valueOf(SysInfo.getMemSize()) + "," +
                 "\"arch\":" + JSONObject.quote(SysInfo.getArchABI()) + "," +
                 "\"kernel_version\":" + JSONObject.quote(SysInfo.getKernelVersion()) + "," +
                 "\"device\":" + JSONObject.quote(SysInfo.getDevice()) + "," +
                 "\"manufacturer\":" + JSONObject.quote(SysInfo.getManufacturer()) + "," +
                 "\"hardware\":" + JSONObject.quote(SysInfo.getHardware()) +
             "}," +
--- a/mobile/android/base/SysInfo.java.in
+++ b/mobile/android/base/SysInfo.java.in
@@ -235,16 +235,9 @@ public final class SysInfo {
     /**
      * @return the Android architecture string, including ABI.
      */
     public static String getArchABI() {
         // Android likes to include the ABI, too ("armeabiv7"), so we
         // differ to add value.
         return android.os.Build.CPU_ABI;
     }
-
-    /**
-     * @return the default system locale, such as "en-US"
-     */
-    public static String getLocale() {
-        return java.util.Locale.getDefault().toString().replace('_', '-');
-    }
 }