Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0214ff9 authored by tom hsu's avatar tom hsu
Browse files

[Panlingual] Fix the back button press

Bug: 226894999
Test: local
Change-Id: I81e6408ebf2587bd023a13dbbdfa97e38efd8c31
parent 6436a5aa
Loading
Loading
Loading
Loading
+1 −15
Original line number Diff line number Diff line
@@ -89,26 +89,12 @@ public class AppLocalePickerActivity extends SettingsBaseActivity
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            handleBackPressed();
            super.onBackPressed();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onBackPressed() {
        handleBackPressed();
    }

    private void handleBackPressed() {
        if (getFragmentManager().getBackStackEntryCount() > 1) {
            super.onBackPressed();
        } else {
            setResult(RESULT_CANCELED);
            finish();
        }
    }

    @Override
    public void onLocaleSelected(LocaleStore.LocaleInfo localeInfo) {
        if (localeInfo == null || localeInfo.getLocale() == null || localeInfo.isSystemLocale()) {