From f96827b33146d535b94798e7885bd024c33a37e5 Mon Sep 17 00:00:00 2001 From: Randy Pfohl Date: Mon, 13 Mar 2023 23:21:56 +0000 Subject: [PATCH] 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 --- .../com/android/quickstep/views/DigitalWellBeingToast.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java index af80d5f51d..7cd6756362 100644 --- a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java +++ b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java @@ -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) {