Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 2868a7e

Browse files
keianhzoMortimerGoro
authored andcommitted
Fixes voice language issue when reset. Also force save the display one (#2692)
1 parent eb9a1ec commit 2868a7e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/DisplayLanguageOptionsView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ protected boolean reset() {
6262
String currentLocale = LocaleUtils.getCurrentLocale();
6363
if (currentLocale.equalsIgnoreCase(systemLocale)) {
6464
setLanguage(LocaleUtils.getIndexForSupportedLocale(systemLocale), false);
65+
SettingsStore.getInstance(getContext()).setDisplayLocale(currentLocale);
6566
return false;
6667

6768
} else {

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/VoiceSearchLanguageOptionsView.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ private void initialize(Context aContext) {
5959
@Override
6060
protected boolean reset() {
6161
String systemLocale = LocaleUtils.getClosestSupportedLocale(getContext(), LocaleUtils.getDeviceLanguage().getId());
62-
String currentLocale = LocaleUtils.getCurrentLocale();
62+
String currentLocale = LocaleUtils.getVoiceSearchLanguage(getContext()).getId();
6363
if (currentLocale.equalsIgnoreCase(systemLocale)) {
6464
setLanguage(LocaleUtils.getIndexForSupportedLocale(systemLocale), false);
65-
return false;
6665

6766
} else {
6867
setLanguage(LocaleUtils.getIndexForSupportedLocale(systemLocale), true);
6968
SettingsStore.getInstance(getContext()).setVoiceSearchLocale(null);
70-
return true;
7169
}
70+
71+
return false;
7272
}
7373

7474
private RadioGroupSetting.OnCheckedChangeListener mLanguageListener = (radioGroup, checkedId, doApply) -> {

0 commit comments

Comments
 (0)