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
diff --git a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java
index af80d5f..7cd6756 100644
--- a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java
+++ b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java
@@ -326,7 +326,11 @@
}
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) {