DocumentsUI: Fix monkey crash
RootCause: In RecyclerView source code, The start method which is called by smoothScrollToPosition method check whether mTargetPosition value equal -1 or not, if equal throw IllegalArgumentException, in stop method mTargetPosition is assigned to -1. Under normal circumestances, smoothScrollToPosition methed should call setTargetPosition method, mTargetPosition is assigned to normal value, but when the setTargetPosition method is called after stop method, mTargetPosition is assigned to -1. In monkey test, start the smoothScroll and stop the smoothScroll faster could cause this issue. The general operation of people will not be the case. Solution: Use try/catch IllegalArgumentException to avoid this case. CRs-Fixed: 1055242 Change-Id: I9a2300240670bebe5d4b47570e62f31674fe26b8
Loading
Please register or sign in to comment