Index: ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java |
diff --git a/ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java b/ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java |
index becf1f4782890dfcdbb8874e4c9a944c0a08e8c6..505cdc0050771a0966d6183e2f7e95990651b044 100644 |
--- a/ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java |
+++ b/ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java |
@@ -4,12 +4,15 @@ |
package org.chromium.ui.base; |
+import android.content.Context; |
import android.content.res.Configuration; |
import android.view.View; |
import org.chromium.base.ApiCompatibilityUtils; |
import org.chromium.base.ApplicationStatus; |
+import org.chromium.base.BaseSwitches; |
import org.chromium.base.CalledByNative; |
+import org.chromium.base.CommandLine; |
import org.chromium.base.JNINamespace; |
import org.chromium.base.LocaleUtils; |
@@ -51,6 +54,18 @@ public class LocalizationUtils { |
} |
/** |
+ * Get the default country code set during install. |
+ * @return country code. |
+ */ |
+ @CalledByNative |
+ private static String getDefaultCountryCode(Context context) { |
+ CommandLine commandLine = CommandLine.getInstance(); |
+ return commandLine.hasSwitch(BaseSwitches.DEFAULT_COUNTRY_CODE_AT_INSTALL) ? |
+ commandLine.getSwitchValue(BaseSwitches.DEFAULT_COUNTRY_CODE_AT_INSTALL) : |
+ context.getResources().getConfiguration().locale.getCountry(); |
newt (away)
2014/10/06 18:34:03
Is context.getResources().getConfiguration().local
Yaron
2014/10/08 00:08:54
Done.
|
+ } |
+ |
+ /** |
* Returns whether the Android layout direction is RTL. |
* |
* Note that the locale direction can be different from layout direction. Two known cases: |