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

Commit aa581604 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "fix: Grab content description before posting to a handler" into main

parents aae38b08 f0c8c555
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -404,6 +404,7 @@ public abstract class ToggleFeaturePreferenceFragment extends BaseSupportFragmen
        preference.setSelectable(false);
        preference.setMaxHeight(displayHalfHeight);
        preference.setKey(KEY_ANIMATED_IMAGE);
        final CharSequence contentDescription = getContentDescriptionForAnimatedIllustration();
        preference.setOnBindListener(view -> {
            // isAnimatable is decided in
            // {@link IllustrationPreference#onBindViewHolder(PreferenceViewHolder)}. Therefore, we
@@ -412,8 +413,7 @@ public abstract class ToggleFeaturePreferenceFragment extends BaseSupportFragmen
            // images are decorative.
            ThreadUtils.getUiThreadHandler().post(() -> {
                if (preference.isAnimatable()) {
                    preference.setContentDescription(
                            getContentDescriptionForAnimatedIllustration());
                    preference.setContentDescription(contentDescription);
                }
            });
        });