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

Commit f96827b3 authored by Randy Pfohl's avatar Randy Pfohl
Browse files

checking if outline provider is null to handle rare NPE

test: verified that a null value wouldn't cause a crash, and would still show the well being toasts correctly. defaulting a value could cause abnormal behavior so I have created a task to follow up with to figure out why this value is being set to null.

bug: 236918951
Change-Id: I9d4282273cb0bc5b6b095dbd082dd1ef79add0dc
parent afdf2f10
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -326,7 +326,11 @@ public final class DigitalWellBeingToast {
    }

    private void setBannerOutline() {
        mOldBannerOutlineProvider = mBanner.getOutlineProvider();
        // TODO(b\273367585) to investigate why mBanner.getOutlineProvider() can be null
        mOldBannerOutlineProvider = mBanner.getOutlineProvider() != null
                ? mBanner.getOutlineProvider()
                : ViewOutlineProvider.BACKGROUND;

        mBanner.setOutlineProvider(new ViewOutlineProvider() {
            @Override
            public void getOutline(View view, Outline outline) {