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

Commit 9de96295 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Fix crash while create windowless splash screen..." into main

parents 887785ab 0b32c63b
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -352,12 +352,17 @@ public class SplashscreenContentDrawer {
    /** Extract the window background color from {@code attrs}. */
    private static int peekWindowBGColor(Context context, SplashScreenWindowAttrs attrs) {
        Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "peekWindowBGColor");
        final Drawable themeBGDrawable;
        Drawable themeBGDrawable = null;
        if (attrs.mWindowBgColor != 0) {
            themeBGDrawable = new ColorDrawable(attrs.mWindowBgColor);
        } else if (attrs.mWindowBgResId != 0) {
            try {
                themeBGDrawable = context.getDrawable(attrs.mWindowBgResId);
        } else {
            } catch (Resources.NotFoundException e) {
                Slog.w(TAG, "Unable get drawable from resource", e);
            }
        }
        if (themeBGDrawable == null) {
            themeBGDrawable = createDefaultBackgroundDrawable();
            Slog.w(TAG, "Window background does not exist, using " + themeBGDrawable);
        }