diff options
| author | 2018-09-05 17:45:43 -0700 | |
|---|---|---|
| committer | 2018-09-18 14:34:16 -0700 | |
| commit | 7d6a5fecf621b945602fe169b52223e6c9edd7c4 (patch) | |
| tree | dca8e1edd3e1ee82eb605405af4e902db8ca27c6 | |
| parent | 2518b2899ca62f2135adbd1fc512fe34e9ef6b93 (diff) | |
Prevent nearest touch frame nearest child crash when no children
NearestTouchFrame crashed because clickable children list was empty,
either there were no children inside the view group or most likely touch
event occured before onMeasure occurred. Fixed by returning early.
Bug: 112740585
Test: tap anywhere on the nav bar
Change-Id: Id0a805fbe039d9e774900e832cb75347f7a619de
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java index 7b9ed88b8b44..34bba6a2e5ca 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java @@ -95,6 +95,9 @@ public class NearestTouchFrame extends FrameLayout { } private View findNearestChild(MotionEvent event) { + if (mClickableChildren.isEmpty()) { + return null; + } return mClickableChildren .stream() .filter(v -> v.isAttachedToWindow()) |