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

Commit 0b32c63b authored by wilsonshih's avatar wilsonshih
Browse files

Fix crash while create windowless splash screen...

...because unable get drawable from resources.

Flag: EXEMPT Bugfix
Bug: 363161259
Test: launch app and verify there will catch exception from throw out.
Change-Id: If0195abc1c78f84b91391fb95eb066f42801c29b
parent 3f98e2b4
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);
        }