From f39128645618f167e35398e556984f68a41388d2 Mon Sep 17 00:00:00 2001 From: Priyank Singh Date: Mon, 22 Apr 2019 10:41:58 -0700 Subject: [PATCH] Handle NPE when the notification shade is opened via click on button. At this time the onScroll events will not be triggered initially and hence the clip bounds are null. Bug: 130168660 Test: Manual Change-Id: If9fef608c65589440183565f4828065a15b19fdc --- .../src/com/android/systemui/statusbar/car/CarStatusBar.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java index a7f8933bf44eb..ae99126a4acd1 100644 --- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java @@ -472,7 +472,10 @@ public class CarStatusBar extends StatusBar implements } boolean isTracking = mIsTracking; Rect rect = mNotificationList.getClipBounds(); - float clippedHeight = rect.bottom; + float clippedHeight = 0; + if (rect != null) { + clippedHeight = rect.bottom; + } if (!handled && event.getActionMasked() == MotionEvent.ACTION_UP && mIsSwipingVerticallyToClose) { if (mSettleClosePercentage < mPercentageFromBottom && isTracking) {