/packages/providers/ContactsProvider/src/com/android/providers/contacts/ |
D | LocaleSet.java | 39 public LocaleWrapper(Locale locale) { in LocaleWrapper() argument 40 mLocale = locale; in LocaleWrapper() 58 public boolean isLocale(Locale locale) { in isLocale() argument 59 return mLocale == null ? (locale == null) : mLocale.equals(locale); in isLocale() 80 public LocaleSet(Locale locale) { in LocaleSet() argument 81 this(locale, null); in LocaleSet() 159 public boolean isPrimaryLocale(Locale locale) { in isPrimaryLocale() argument 160 return mPrimaryLocale.isLocale(locale); in isPrimaryLocale() 163 public boolean isSecondaryLocale(Locale locale) { in isSecondaryLocale() argument 164 return mSecondaryLocale.isLocale(locale); in isSecondaryLocale() [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/spellcheck/ |
D | AndroidSpellCheckerService.java | 183 for (final Locale locale : mCachedLocales) { in onSharedPreferenceChanged() 185 mDictionaryFacilitatorCache.get(locale); in onSharedPreferenceChanged() 187 dictionaryFacilitator, locale, mUseContactsDictionary); in onSharedPreferenceChanged() 221 public boolean isValidWord(final Locale locale, final String word) { in isValidWord() argument 225 getDictionaryFacilitatorForLocaleLocked(locale); in isValidWord() 232 public SuggestionResults getSuggestionResults(final Locale locale, final WordComposer composer, in getSuggestionResults() argument 239 getDictionaryFacilitatorForLocaleLocked(locale); in getSuggestionResults() 250 public boolean hasMainDictionaryForLocale(final Locale locale) { in hasMainDictionaryForLocale() argument 254 getDictionaryFacilitatorForLocaleLocked(locale); in hasMainDictionaryForLocale() 261 private DictionaryFacilitator getDictionaryFacilitatorForLocaleLocked(final Locale locale) { in getDictionaryFacilitatorForLocaleLocked() argument [all …]
|
/packages/apps/Settings/src/com/android/settings/inputmethod/ |
D | UserDictionaryList.java | 64 final String locale; in onActivityCreated() local 66 locale = localeFromArguments; in onActivityCreated() 68 locale = localeFromIntent; in onActivityCreated() 70 locale = null; in onActivityCreated() 72 mLocale = locale; in onActivityCreated() 88 final String locale = cursor.getString(columnIndex); in getUserDictionaryLocalesSet() local 89 localeSet.add(null != locale ? locale : ""); in getUserDictionaryLocalesSet() 111 final String locale = subtype.getLocale(); in getUserDictionaryLocalesSet() local 112 if (!TextUtils.isEmpty(locale)) { in getUserDictionaryLocalesSet() 113 localeSet.add(locale); in getUserDictionaryLocalesSet() [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/ |
D | DictionaryInfoUtils.java | 65 public DictionaryInfo(final String id, final Locale locale, final String description, in DictionaryInfo() argument 68 mLocale = locale; in DictionaryInfo() 189 private static String getCacheDirectoryForLocale(final String locale, final Context context) { in getCacheDirectoryForLocale() argument 190 final String relativeDirectoryName = replaceFileNameDangerousCharacters(locale); in getCacheDirectoryForLocale() 196 Log.e(TAG, "Could not create the directory for locale" + locale); in getCacheDirectoryForLocale() 217 public static String getCacheFileName(String id, String locale, Context context) { in getCacheFileName() argument 219 return getCacheDirectoryForLocale(locale, context) + File.separator + fileName; in getCacheFileName() 236 final Locale locale) { in getMainDictionaryResourceIdIfAvailableForLocale() argument 239 if (!locale.getCountry().isEmpty()) { in getMainDictionaryResourceIdIfAvailableForLocale() 241 MAIN_DICT_PREFIX + locale.toString().toLowerCase(Locale.ROOT); in getMainDictionaryResourceIdIfAvailableForLocale() [all …]
|
D | StringUtils.java | 132 public static String capitalizeFirstCodePoint(final String s, final Locale locale) { in capitalizeFirstCodePoint() argument 134 return s.toUpperCase(locale); in capitalizeFirstCodePoint() 139 return s.substring(0, cutoff).toUpperCase(locale) + s.substring(cutoff); in capitalizeFirstCodePoint() 142 public static String capitalizeFirstAndDowncaseRest(final String s, final Locale locale) { in capitalizeFirstAndDowncaseRest() argument 144 return s.toUpperCase(locale); in capitalizeFirstAndDowncaseRest() 155 return s.substring(0, cutoff).toUpperCase(locale) + s.substring(cutoff).toLowerCase(locale); in capitalizeFirstAndDowncaseRest() 325 final Locale locale) { in capitalizeEachWord() argument 332 builder.append(nextChar.toUpperCase(locale)); in capitalizeEachWord() 334 builder.append(nextChar.toLowerCase(locale)); in capitalizeEachWord() 493 final boolean needsToUpperCase, final Locale locale) { in toUpperCaseOfStringForLocale() argument [all …]
|
D | DistracterFilterCheckingExactMatchesAndSuggestions.java | 93 final Locale locale = SubtypeLocaleUtils.getSubtypeLocale(subtype); in updateEnabledSubtypes() local 94 if (newLocaleToSubtypeMap.containsKey(locale)) { in updateEnabledSubtypes() 99 newLocaleToSubtypeMap.put(locale, subtype); in updateEnabledSubtypes() 159 final String testedWord, final Locale locale) { in isDistracterToWordsInDictionaries() argument 160 if (locale == null) { in isDistracterToWordsInDictionaries() 163 if (!locale.equals(mDictionaryFacilitator.getLocale())) { in isDistracterToWordsInDictionaries() 165 if (!mLocaleToSubtypeMap.containsKey(locale)) { in isDistracterToWordsInDictionaries() 166 Log.e(TAG, "Locale " + locale + " is not enabled."); in isDistracterToWordsInDictionaries() 170 loadKeyboardForLocale(locale); in isDistracterToWordsInDictionaries() 174 loadDictionariesForLocale(locale); in isDistracterToWordsInDictionaries()
|
D | LanguageModelParam.java | 130 final Locale locale = dictionaryFacilitator.getLocale(); in detectWhetherVaildWordOrNotAndGetLanguageModelParam() local 131 if (locale == null) { in detectWhetherVaildWordOrNotAndGetLanguageModelParam() 136 true /* isValidWord */, locale, distracterFilter); in detectWhetherVaildWordOrNotAndGetLanguageModelParam() 139 final String lowerCaseTargetWord = targetWord.toLowerCase(locale); in detectWhetherVaildWordOrNotAndGetLanguageModelParam() 143 timestamp, true /* isValidWord */, locale, distracterFilter); in detectWhetherVaildWordOrNotAndGetLanguageModelParam() 148 false /* isValidWord */, locale, distracterFilter); in detectWhetherVaildWordOrNotAndGetLanguageModelParam() 153 final boolean isValidWord, final Locale locale, in createAndGetLanguageModelParamOfWord() argument 158 word = targetWord.toLowerCase(locale); in createAndGetLanguageModelParamOfWord() 163 if (distracterFilter.isDistracterToWordsInDictionaries(prevWordsInfo, word, locale)) { in createAndGetLanguageModelParamOfWord()
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/userdictionary/ |
D | UserDictionaryList.java | 68 final String locale = cursor.getString(columnIndex); in getUserDictionaryLocalesSet() local 69 localeSet.add(null != locale ? locale : ""); in getUserDictionaryLocalesSet() 89 final String locale = subtype.getLocale(); in getUserDictionaryLocalesSet() local 90 if (!TextUtils.isEmpty(locale)) { in getUserDictionaryLocalesSet() 91 localeSet.add(locale); in getUserDictionaryLocalesSet() 126 for (String locale : localeSet) { in createUserDictSettings() 127 userDictGroup.addPreference(createUserDictionaryPreference(locale, activity)); in createUserDictSettings() 137 protected Preference createUserDictionaryPreference(String locale, Activity activity) { in createUserDictionaryPreference() argument 140 if (null == locale) { in createUserDictionaryPreference() 143 if ("".equals(locale)) in createUserDictionaryPreference() [all …]
|
D | UserDictionarySettings.java | 133 final String locale; in onActivityCreated() local 135 locale = localeFromArguments; in onActivityCreated() 137 locale = localeFromIntent; in onActivityCreated() 139 locale = null; in onActivityCreated() 142 mLocale = locale; in onActivityCreated() 148 mCursor = createCursor(locale); in onActivityCreated() 164 private Cursor createCursor(final String locale) { in createCursor() argument 175 if ("".equals(locale)) { in createCursor() 181 final String queryLocale = null != locale ? locale : Locale.getDefault().toString(); in createCursor() 205 final Locale systemLocale = getResources().getConfiguration().locale; in onCreateOptionsMenu()
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/ |
D | DictionaryFactory.java | 50 final Locale locale, final boolean useFullEditDistance) { in createMainDictionaryFromManager() argument 51 if (null == locale) { in createMainDictionaryFromManager() 54 createReadOnlyBinaryDictionary(context, locale)); in createMainDictionaryFromManager() 59 BinaryDictionaryGetter.getDictionaryFiles(locale, context); in createMainDictionaryFromManager() 64 useFullEditDistance, locale, Dictionary.TYPE_MAIN); in createMainDictionaryFromManager() 136 final Locale locale) { in createMainDictionaryFromManager() argument 137 return createMainDictionaryFromManager(context, locale, false /* useFullEditDistance */); in createMainDictionaryFromManager() 147 final Locale locale) { in createReadOnlyBinaryDictionary() argument 151 context.getResources(), locale); in createReadOnlyBinaryDictionary() 166 false /* useFullEditDistance */, locale, Dictionary.TYPE_MAIN); in createReadOnlyBinaryDictionary() [all …]
|
D | DictionaryFacilitator.java | 111 public Dictionaries(final Locale locale, final Dictionary mainDict, in Dictionaries() argument 113 mLocale = locale; in Dictionaries() 190 final Context context, final Locale locale, final File dictFile, in getSubDict() argument 201 new Object[] { context, locale, dictFile, dictNamePrefix }); in getSubDict() 290 private void asyncReloadMainDictionary(final Context context, final Locale locale, in asyncReloadMainDictionary() argument 298 DictionaryFactory.createMainDictionaryFromManager(context, locale); in asyncReloadMainDictionary() 300 if (locale.equals(mDictionaries.mLocale)) { in asyncReloadMainDictionary() 316 public void resetDictionariesForTesting(final Context context, final Locale locale, in resetDictionariesForTesting() argument 324 mainDictionary = DictionaryFactory.createMainDictionaryFromManager(context, locale); in resetDictionariesForTesting() 328 dictType, context, locale, dictFile, "" /* dictNamePrefix */); in resetDictionariesForTesting() [all …]
|
D | BinaryDictionaryGetter.java | 159 public static File[] getCachedWordLists(final String locale, final Context context) { in getCachedWordLists() argument 167 final int matchLevel = LocaleUtils.getMatchLevel(dirLocale, locale); in getCachedWordLists() 227 private static boolean hackCanUseDictionaryFile(final Locale locale, final File file) { in hackCanUseDictionaryFile() argument 264 public static ArrayList<AssetFileAddress> getDictionaryFiles(final Locale locale, in getDictionaryFiles() argument 267 final boolean hasDefaultWordList = DictionaryFactory.isDictionaryAvailable(context, locale); in getDictionaryFiles() 268 BinaryDictionaryFileDumper.cacheWordListsFromContentProvider(locale, context, in getDictionaryFiles() 270 final File[] cachedWordLists = getCachedWordLists(locale.toString(), context); in getDictionaryFiles() 271 final String mainDictId = DictionaryInfoUtils.getMainDictId(locale); in getDictionaryFiles() 279 final boolean canUse = f.canRead() && hackCanUseDictionaryFile(locale, f); in getDictionaryFiles() 294 DictionaryInfoUtils.getMainDictionaryResourceId(context.getResources(), locale); in getDictionaryFiles()
|
D | UserBinaryDictionary.java | 70 protected UserBinaryDictionary(final Context context, final Locale locale, in UserBinaryDictionary() argument 72 super(context, getDictName(name, locale, dictFile), locale, Dictionary.TYPE_USER, dictFile); in UserBinaryDictionary() 73 if (null == locale) throw new NullPointerException(); // Catch the error earlier in UserBinaryDictionary() 74 final String localeStr = locale.toString(); in UserBinaryDictionary() 105 public static UserBinaryDictionary getDictionary(final Context context, final Locale locale, in getDictionary() argument 107 return new UserBinaryDictionary(context, locale, false /* alsoUseMoreRestrictiveLocales */, in getDictionary() 223 public static void addWordToUserDictionary(final Context context, final Locale locale, in addWordToUserDictionary() argument 227 HISTORICAL_DEFAULT_USER_DICTIONARY_FREQUENCY, null, locale); in addWordToUserDictionary()
|
D | ContactsBinaryDictionary.java | 77 protected ContactsBinaryDictionary(final Context context, final Locale locale, in ContactsBinaryDictionary() argument 79 super(context, getDictName(name, locale, dictFile), locale, Dictionary.TYPE_CONTACTS, in ContactsBinaryDictionary() 81 mUseFirstLastBigrams = useFirstLastBigramsForLocale(locale); in ContactsBinaryDictionary() 87 public static ContactsBinaryDictionary getDictionary(final Context context, final Locale locale, in getDictionary() argument 89 return new ContactsBinaryDictionary(context, locale, dictFile, dictNamePrefix + NAME); in getDictionary() 167 private boolean useFirstLastBigramsForLocale(final Locale locale) { in useFirstLastBigramsForLocale() argument 169 if (locale != null && locale.getLanguage().equals(Locale.ENGLISH.getLanguage())) { in useFirstLastBigramsForLocale()
|
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/system/ |
D | CaptionSetupActivity.java | 785 public Locale locale; field in CaptionSetupActivity.LocaleInfo 787 public LocaleInfo(String label, Locale locale) { in LocaleInfo() argument 789 this.locale = locale; in LocaleInfo() 820 final Locale locale = Locale.forLanguageTag(localeStr.replace('_', '-')); in getLanguages() local 822 if ("und".equals(locale.getLanguage()) || locale.getLanguage().isEmpty() || in getLanguages() 823 locale.getCountry().isEmpty()) { in getLanguages() 829 new LocaleInfo(locale.getDisplayLanguage(locale), locale); in getLanguages() 836 if (previous.locale.getLanguage().equals(locale.getLanguage()) in getLanguages() 837 && !previous.locale.getLanguage().equals("zz")) { in getLanguages() 839 localeInfos[finalSize - 1].locale, specialLocaleCodes, in getLanguages() [all …]
|
/packages/inputmethods/LatinIME/tools/make-keyboard-text/src/com/android/inputmethod/keyboard/tools/ |
D | MoreKeysResources.java | 76 for (final String locale : mResourcesMap.keySet()) { in MoreKeysResources() 77 final StringResourceMap resMap = mResourcesMap.get(locale); in MoreKeysResources() 81 throw new RuntimeException(res.mName + " in " + locale in MoreKeysResources() 169 private static String getArrayNameForLocale(final Locale locale) { in getArrayNameForLocale() argument 170 return TEXTS_ARRAY_NAME_PREFIX + LocaleUtils.getLocaleCode(locale); in getArrayNameForLocale() 175 final Locale locale = resMap.mLocale; in dumpTexts() local 178 locale, LocaleUtils.getLocaleDisplayName(locale)); in dumpTexts() 179 out.format(" private static final String[] " + getArrayNameForLocale(locale) in dumpTexts() 189 final Locale locale = resMap.mLocale; in dumpLocalesMap() local 190 final String localeStr = LocaleUtils.getLocaleCode(locale); in dumpLocalesMap() [all …]
|
D | LocaleUtils.java | 91 final Locale locale = builder.build(); in constructLocaleFromString() local 92 sLocaleCache.put(localeStr, locale); in constructLocaleFromString() 93 return locale; in constructLocaleFromString() 151 public static String getLocaleCode(final Locale locale) { in getLocaleCode() argument 152 if (locale == DEFAULT_LOCALE) { in getLocaleCode() 155 return locale.toString(); in getLocaleCode() 158 public static String getLocaleDisplayName(final Locale locale) { in getLocaleDisplayName() argument 159 if (locale == DEFAULT_LOCALE) { in getLocaleDisplayName() 162 if (locale.getLanguage().equals(NO_LANGUAGE_LOCALE_CODE)) { in getLocaleDisplayName() 165 return locale.getDisplayName(Locale.ENGLISH); in getLocaleDisplayName()
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/keyboard/layout/expected/ |
D | ExpectedKey.java | 147 public ExpectedKey toUpperCase(Locale locale) { in toUpperCase() argument 148 return newInstance(mVisual.toUpperCase(locale), mOutput.toUpperCase(locale)); in toUpperCase() 221 public ExpectedAdditionalMoreKey toUpperCase(final Locale locale) { in toUpperCase() argument 222 final ExpectedKey upperCaseKey = super.toUpperCase(locale); in toUpperCase() 241 public ExpectedKey toUpperCase(final Locale locale) { in toUpperCase() argument 244 upperCaseMoreKeys[i] = mMoreKeys[i].toUpperCase(locale); in toUpperCase() 246 return newInstance(getVisual().toUpperCase(locale), getOutput().toUpperCase(locale), in toUpperCase() 346 public ExpectedKey toUpperCase(final Locale locale) { in toUpperCase() argument 350 upperCaseMoreKeys[i] = moreKeys[i].toUpperCase(locale); in toUpperCase() 355 upperCaseAdditionalMoreKeys[i] = mAdditionalMoreKeys[i].toUpperCase(locale); in toUpperCase() [all …]
|
/packages/inputmethods/LatinIME/tools/make-keyboard-text/res/src/com/android/inputmethod/keyboard/internal/ |
D | KeyboardTextsTable.tmpl | 32 * tools/make-keyboard-text/res/values-<locale>/donottranslate-more-keys.xml 49 // Texts table to locale maps. 55 throw new RuntimeException("Unknown text name=" + name + " locale=" 69 + " locale=" + sTextsTableToLocaleMap.get(textsTable)); 72 public static String[] getTextsTable(final Locale locale) { 73 final String localeKey = locale.toString(); 77 final String languageKey = locale.getLanguage(); 98 // "locale", TEXT_ARRAY, /* numberOfNonNullText/lengthOf_TEXT_ARRAY localeName */ 108 final String locale = (String)LOCALES_AND_TEXTS[i]; 110 sLocaleToTextsTableMap.put(locale, textsTable); [all …]
|
/packages/apps/Settings/src/com/android/settings/ |
D | UserDictionarySettings.java | 99 final String locale; in onActivityCreated() local 101 locale = localeFromArguments; in onActivityCreated() 103 locale = localeFromIntent; in onActivityCreated() 105 locale = null; in onActivityCreated() 108 mLocale = locale; in onActivityCreated() 109 mCursor = createCursor(locale); in onActivityCreated() 124 private Cursor createCursor(final String locale) { in createCursor() argument 135 if ("".equals(locale)) { in createCursor() 141 final String queryLocale = null != locale ? locale : Locale.getDefault().toString(); in createCursor()
|
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/ |
D | ContactLocaleUtilsTest.java | 112 final Locale locale[] = Collator.getAvailableLocales(); in setUp() local 113 for (int i = 0; i < locale.length; i++) { in setUp() 114 if (LocaleSet.isLocaleSimplifiedChinese(locale[i])) { in setUp() 116 } else if (LocaleSet.isLocaleTraditionalChinese(locale[i])) { in setUp() 118 } else if (locale[i].equals(Locale.JAPAN)) { in setUp() 120 } else if (locale[i].equals(Locale.KOREA)) { in setUp() 122 } else if (locale[i].equals(LOCALE_ARABIC)) { in setUp() 124 } else if (locale[i].equals(Locale.GERMANY)) { in setUp() 126 } else if (locale[i].equals(LOCALE_SERBIAN)) { in setUp() 128 } else if (locale[i].equals(LOCALE_UKRAINIAN)) { in setUp()
|
/packages/apps/Settings/src/com/android/settings/tts/ |
D | TtsEngineSettingsFragment.java | 244 Locale locale = mEnginesHelper.parseLocaleString(availableLangs.get(i)); in updateDefaultLocalePref() local 245 if (locale != null){ in updateDefaultLocalePref() 247 locale.getDisplayName(), locale)); in updateDefaultLocalePref() 333 private void updateLanguageTo(Locale locale) { in updateLanguageTo() argument 335 String localeString = (locale != null) ? locale.toString() : ""; in updateLanguageTo() 350 mEnginesHelper.updateLocalePrefForEngine(getEngineName(), locale); in updateLanguageTo() local 354 mTts.setLanguage((locale != null) ? locale : Locale.getDefault()); in updateLanguageTo()
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/keyboard/internal/ |
D | KeyboardTextsSetTests.java | 61 final Locale locale = SubtypeLocaleUtils.getSubtypeLocale(subtype); in testSwitchToAlphaKeyLabel() local 62 textsSet.setLocale(locale, context); in testSwitchToAlphaKeyLabel() 65 assertNotNull("Switch to alpha key label of " + locale, switchToAlphaKeyLabel); in testSwitchToAlphaKeyLabel() 66 assertFalse("Switch to alpha key label of " + locale, switchToAlphaKeyLabel.isEmpty()); in testSwitchToAlphaKeyLabel() 87 final Locale locale = SubtypeLocaleUtils.getSubtypeLocale(subtype); in testTextFromResources() local 88 textsSet.setLocale(locale, context); in testTextFromResources() 91 assertNotNull(name + " of " + locale, text); in testTextFromResources() 92 assertFalse(name + " of " + locale, text.isEmpty()); in testTextFromResources()
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/personalization/ |
D | PersonalizationHelper.java | 40 final Context context, final Locale locale) { in getUserHistoryDictionary() argument 41 final String localeStr = locale.toString(); in getUserHistoryDictionary() 49 Log.w(TAG, "Use cached UserHistoryDictionary for " + locale); in getUserHistoryDictionary() 55 final UserHistoryDictionary dict = new UserHistoryDictionary(context, locale); in getUserHistoryDictionary() 94 final Context context, final Locale locale) { in getPersonalizationDictionary() argument 95 final String localeStr = locale.toString(); in getPersonalizationDictionary() 103 Log.w(TAG, "Use cached PersonalizationDictionary for " + locale); in getPersonalizationDictionary() 108 final PersonalizationDictionary dict = new PersonalizationDictionary(context, locale); in getPersonalizationDictionary()
|
/packages/apps/Gallery2/src/com/android/gallery3d/util/ |
D | ReverseGeocoder.java | 325 Locale locale = address.getLocale(); in lookupAddress() local 326 writeUTF(dos, locale.getLanguage()); in lookupAddress() 327 writeUTF(dos, locale.getCountry()); in lookupAddress() 328 writeUTF(dos, locale.getVariant()); in lookupAddress() 360 Locale locale = null; in lookupAddress() local 363 locale = new Locale(language); in lookupAddress() 365 locale = new Locale(language, country); in lookupAddress() 367 locale = new Locale(language, country, variant); in lookupAddress() 370 if (!locale.getLanguage().equals(Locale.getDefault().getLanguage())) { in lookupAddress() 374 address = new Address(locale); in lookupAddress()
|