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

Unverified Commit 9313ed83 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-11.0.0_r38' into staging/lineage-18.1_merge-android-11.0.0_r38

Android 11.0.0 Release 38 (RQ3A.210605.005)

* tag 'android-11.0.0_r38':
  Fix can't find default theme bundle for some specific languages.

Change-Id: I42391693f0462a1b77ba6c4af64a746994a1dbe5
parents 05efb679 d7768bf3
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -287,9 +287,10 @@ public class ThemeFragment extends AppbarFragment {
                mSelectedTheme = previouslySelectedTheme != null
                        ? previouslySelectedTheme
                        : activeTheme;
                // 3. Select the default theme if there is no matching custom enabled theme.
                // 3. Select the first system theme(default theme currently)
                //    if there is no matching custom enabled theme.
                if (mSelectedTheme == null) {
                    mSelectedTheme = findDefaultThemeBundle(options);
                    mSelectedTheme = findFirstSystemThemeBundle(options);
                }

                mOptionsController.setSelectedOption(mSelectedTheme);
@@ -324,8 +325,7 @@ public class ThemeFragment extends AppbarFragment {
                }
            }
            if (mSelectedTheme == null) {
                // Select the default theme if there is no matching custom enabled theme
                mSelectedTheme = findDefaultThemeBundle(options);
                mSelectedTheme = findFirstSystemThemeBundle(options);
            }
            mOptionsController.setSelectedOption(mSelectedTheme);
            // Set selected option above will show BottomActionBar,
@@ -334,11 +334,9 @@ public class ThemeFragment extends AppbarFragment {
        }, true);
    }

    private ThemeBundle findDefaultThemeBundle(List<ThemeBundle> options) {
        String defaultThemeTitle =
                getActivity().getResources().getString(R.string.default_theme_title);
    private ThemeBundle findFirstSystemThemeBundle(List<ThemeBundle> options) {
        for (ThemeBundle bundle : options) {
            if (bundle.getTitle().equals(defaultThemeTitle)) {
            if (!(bundle instanceof CustomTheme)) {
                return bundle;
            }
        }