Aggressively reset SwipeHelper state
* Resetting just swipe (used internally as resetSwipeState) when snap was also in progress will now clear the mSnappingChild field, which also ensures snapChildIfNeeded() doesn't return early. * Resetting all state (used externally as resetTouchState) will always clear mSnappingChild and will cancel snap animations and reset state. * NSSL will now also resetTouchState whenever the notifications are hidden or unhidden. These changes all assume that the mTouchedView still pointed to the view which was misaligned in order to fix the bug. If the mTouchedView does NOT point to the misaligned view, then the fix for this bug is going to require one of two things: 1) we could track all active swipe/snap/dismiss views, rather than just the latest one, so that we can appropriately tear down all state. This is a major project. 2) we could, when notifications become visible, iterate all rows recursively and reset all their swipe translations naively. I'm worried about possible jank this could cause. Fixes: 259529672 Test: dumpsysui SwipeHelper Test: atest NotificationStackScrollLayoutTest Change-Id: I53d8e217e7f133388943e07be088d63623c4b735
Loading
Please register or sign in to comment