diff options
| author | 2022-01-11 14:58:16 +0000 | |
|---|---|---|
| committer | 2022-01-11 15:27:05 +0000 | |
| commit | 4ac20f1255fb30e94e1d29e56579f1409922763c (patch) | |
| tree | e90426e1c313433c191d841b8b342adc7f278253 | |
| parent | 5e154e8d5b8e5188791c53dc561be9afee5461d6 (diff) | |
Prevent a crash when constructing NSSL.
The dependent change was validated on qt-dev and rvc-dev, but not explicitly on qt-qpr1-dev.
 - In qt-dev, we didn't have this check that the footer view was initialized, but hasActiveClearableNotifications did not call into the mDynamicPrivacyController (it didn't exist), so there was no initialization-time NPE.
 - In rvc-dev this footer view check existed, so updateFooter never did any work until setFooterView was called, which is strictly after mDynamicPrivacyController is initialized, so there was no crash.
 - In qt-qpr1-dev, mDynamicPrivacyController was added and is checked within updateFooter, but updateFooter didn't have the view check to short circuit before doing that on initialization.
Bug: 193149550
Fixes: 206344625
Test: manually run qt-qpr1-dev with and without fix
Depends-On: I49e2b8bcec7b2ce0a9776ff30a64c07f24949da7
Change-Id: If6e99b5fbe3d2a9d9274223c35d23c30f5524229
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java | 3 | 
1 files changed, 3 insertions, 0 deletions
| diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 86003264811e..af155034c396 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -707,6 +707,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd      @VisibleForTesting      @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)      public void updateFooter() { +        if (mFooterView == null) { +            return; +        }          boolean showDismissView = mClearAllEnabled && hasActiveClearableNotifications(ROWS_ALL);          boolean showFooterView = (showDismissView ||                  mEntryManager.getNotificationData().getActiveNotifications().size() != 0) |