[Regional Preference] Do not get child fragment if the fragment is not

added

Bug: 279376395
Test: local test
Change-Id: I352597dedf2ba7770936d44d09aa111762f94502
This commit is contained in:
Zoey Chen
2023-04-24 11:56:05 +00:00
parent 134bea1957
commit cec01e38ef
2 changed files with 12 additions and 4 deletions

View File

@@ -319,8 +319,9 @@ class LocaleDragAndDropAdapter
public void doTheUpdateWithMovingLocaleItem() {
LocaleStore.LocaleInfo localeInfo = mFeedItemList.get(0);
final LocaleDialogFragment fragment = LocaleDialogFragment.newInstance();
if (!localeInfo.getLocale().equals(LocalePicker.getLocales().get(0))) {
LocaleDialogFragment.show(mParent,
fragment.show(mParent,
LocaleDialogFragment.DIALOG_CONFIRM_SYSTEM_DEFAULT,
localeInfo,
new ResultReceiver(new Handler(Looper.getMainLooper())) {
@@ -332,7 +333,7 @@ class LocaleDragAndDropAdapter
if (resultCode == Activity.RESULT_OK) {
doTheUpdate();
if (!localeInfo.isTranslated()) {
LocaleDialogFragment.show(mParent,
fragment.show(mParent,
LocaleDialogFragment
.DIALOG_NOT_AVAILABLE_LOCALE,
localeInfo);