Loading src/java/com/android/internal/telephony/MccTable.java +2 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.content.Context; import android.content.res.Configuration; import android.icu.util.ULocale; import android.os.Build; import android.os.RemoteException; import android.os.SystemProperties; Loading @@ -29,7 +30,6 @@ import android.util.Slog; import com.android.internal.app.LocaleStore; import com.android.internal.app.LocaleStore.LocaleInfo; import libcore.icu.ICU; import libcore.timezone.TimeZoneFinder; import java.util.ArrayList; Loading Loading @@ -149,7 +149,7 @@ public final class MccTable { } // Ask CLDR for the language this country uses... Locale likelyLocale = ICU.addLikelySubtags(new Locale("und", country)); ULocale likelyLocale = ULocale.addLikelySubtags(new ULocale("und", country)); String likelyLanguage = likelyLocale.getLanguage(); Slog.d(LOG_TAG, "defaultLanguageForMcc(" + mcc + "): country " + country + " uses " + likelyLanguage); Loading src/java/com/android/internal/telephony/cat/CatService.java +8 −1 Original line number Diff line number Diff line Loading @@ -1178,7 +1178,14 @@ public class CatService extends Handler implements AppInterface { private void changeLanguage(String language) throws RemoteException { IActivityManager am = ActivityManagerNative.getDefault(); Configuration config = am.getConfiguration(); config.setLocales(new LocaleList(new Locale(language), LocaleList.getDefault())); // get locale list, combined with language locale and default locale list. LocaleList defaultLocaleList = LocaleList.getDefault(); Locale[] locales = new Locale[defaultLocaleList.size() + 1]; locales[0] = new Locale(language); for (int i = 0; i < defaultLocaleList.size(); i++) { locales[i+1] = defaultLocaleList.get(i); } config.setLocales(new LocaleList(locales)); config.userSetLocale = true; am.updatePersistentConfiguration(config); BackupManager.dataChanged("com.android.providers.settings"); Loading Loading
src/java/com/android/internal/telephony/MccTable.java +2 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.content.Context; import android.content.res.Configuration; import android.icu.util.ULocale; import android.os.Build; import android.os.RemoteException; import android.os.SystemProperties; Loading @@ -29,7 +30,6 @@ import android.util.Slog; import com.android.internal.app.LocaleStore; import com.android.internal.app.LocaleStore.LocaleInfo; import libcore.icu.ICU; import libcore.timezone.TimeZoneFinder; import java.util.ArrayList; Loading Loading @@ -149,7 +149,7 @@ public final class MccTable { } // Ask CLDR for the language this country uses... Locale likelyLocale = ICU.addLikelySubtags(new Locale("und", country)); ULocale likelyLocale = ULocale.addLikelySubtags(new ULocale("und", country)); String likelyLanguage = likelyLocale.getLanguage(); Slog.d(LOG_TAG, "defaultLanguageForMcc(" + mcc + "): country " + country + " uses " + likelyLanguage); Loading
src/java/com/android/internal/telephony/cat/CatService.java +8 −1 Original line number Diff line number Diff line Loading @@ -1178,7 +1178,14 @@ public class CatService extends Handler implements AppInterface { private void changeLanguage(String language) throws RemoteException { IActivityManager am = ActivityManagerNative.getDefault(); Configuration config = am.getConfiguration(); config.setLocales(new LocaleList(new Locale(language), LocaleList.getDefault())); // get locale list, combined with language locale and default locale list. LocaleList defaultLocaleList = LocaleList.getDefault(); Locale[] locales = new Locale[defaultLocaleList.size() + 1]; locales[0] = new Locale(language); for (int i = 0; i < defaultLocaleList.size(); i++) { locales[i+1] = defaultLocaleList.get(i); } config.setLocales(new LocaleList(locales)); config.userSetLocale = true; am.updatePersistentConfiguration(config); BackupManager.dataChanged("com.android.providers.settings"); Loading