[Regional Preferences] Remove u extension for subtitle of Language
- Remove the language tag info of subtitle in Settings -> System -> Languages - Syuc same result to entry of numbering system. Bug: b/268278327 Bug: b/268276472 Test: atest passed Test: Manual test passed Change-Id: I46dd0899059e9209b99f5ef3b7b84eb083d4e140
This commit is contained in:
@@ -27,10 +27,16 @@ public class LocaleFeatureProviderImpl implements LocaleFeatureProvider {
|
||||
@Override
|
||||
public String getLocaleNames() {
|
||||
final LocaleList locales = LocalePicker.getLocales();
|
||||
Locale[] arrLocalesWithoutExtension = new Locale[locales.size()];
|
||||
for (int i = 0; i < locales.size(); i++) {
|
||||
arrLocalesWithoutExtension[i] = locales.get(i).stripExtensions();
|
||||
}
|
||||
final Locale displayLocale = Locale.getDefault();
|
||||
return LocaleHelper.toSentenceCase(
|
||||
LocaleHelper.getDisplayLocaleList(
|
||||
locales, displayLocale, 2 /* Show up to two locales from the list */),
|
||||
new LocaleList(arrLocalesWithoutExtension),
|
||||
displayLocale,
|
||||
2 /* Show up to two locales from the list */),
|
||||
displayLocale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,9 @@
|
||||
package com.android.settings.regionalpreferences;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.LocaleList;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.StringJoiner;
|
||||
import com.android.settings.localepicker.LocaleFeatureProviderImpl;
|
||||
|
||||
/** A controller for the entry of Numbering System's page */
|
||||
public class NumberingSystemController extends BasePreferenceController {
|
||||
@@ -50,12 +47,6 @@ public class NumberingSystemController extends BasePreferenceController {
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
LocaleList localeList = LocaleList.getDefault();
|
||||
StringJoiner stringJoiner = new StringJoiner(", ");
|
||||
for (int i = 0; i < localeList.size(); i++) {
|
||||
Locale locale = localeList.get(i);
|
||||
stringJoiner.add(locale.stripExtensions().getDisplayName(locale));
|
||||
}
|
||||
return stringJoiner.toString();
|
||||
return new LocaleFeatureProviderImpl().getLocaleNames();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user