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

Commit 9bd458c8 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Change overlay on background thread.

This avoids ANRs when the system is busy and won't halt
our main thread.

Test: set light and dark wallpapers, look at qt and lock screen.
Change-Id: Ibe4d085b80195b1022220704ca1f5c0bc30438a3
Fixes: 65691064
parent dedcab0b
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -4515,12 +4515,14 @@ public class StatusBar extends SystemUI implements DemoMode,
        final boolean useDarkTheme = systemColors != null
                && (systemColors.getColorHints() & WallpaperColors.HINT_SUPPORTS_DARK_THEME) != 0;
        if (isUsingDarkTheme() != useDarkTheme) {
            mUiOffloadThread.submit(() -> {
                try {
                    mOverlayManager.setEnabled("com.android.systemui.theme.dark",
                            useDarkTheme, mCurrentUserId);
                } catch (RemoteException e) {
                    Log.w(TAG, "Can't change theme", e);
                }
            });
        }

        // Lock wallpaper defines the color of the majority of the views, hence we'll use it