summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ioana Alexandru <aioana@google.com> 2023-03-08 12:48:50 +0000
committer Ioana Alexandru <aioana@google.com> 2023-03-08 12:48:50 +0000
commite20411b81327b6a6c271e9efa5a58f4a802b4c1c (patch)
tree6d1e7ff197c90132b48dd622bb061b8b62a5dbb4
parente8544a37420639fdcc2854c6a5eeb09607168e22 (diff)
Fix null checks in isInVisibleLocation.
Prevent an NPE when row is null; remove unnecessary check for viewState, since getViewState is @NonNull. Fix: 271467317 Test: presubmit Change-Id: Ia8e48b993893a81f8dd3ae4584fa1f48d9120460
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
index 42d122d6f9ac..3fd87b88f770 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
@@ -828,18 +828,16 @@ public class NotificationStackScrollLayoutController {
private boolean isInVisibleLocation(NotificationEntry entry) {
ExpandableNotificationRow row = entry.getRow();
- ExpandableViewState childViewState = row.getViewState();
-
- if (childViewState == null) {
+ if (row == null) {
return false;
}
+
+ ExpandableViewState childViewState = row.getViewState();
if ((childViewState.location & ExpandableViewState.VISIBLE_LOCATIONS) == 0) {
return false;
}
- if (row.getVisibility() != View.VISIBLE) {
- return false;
- }
- return true;
+
+ return row.getVisibility() == View.VISIBLE;
}
public boolean isViewAffectedBySwipe(ExpandableView expandableView) {