fix crashes by the specified ACTION_VIEW intent
The intent with ACTION_VIEW and authority com.android.externalstorage.documents: will make DocumentsUI crash. The root cause is that the intent will produce the follwoing Uri. content://com.android.externalstorage.documents/document/primary The path segment 0 is "document" and not equal with "root" so DocumentsContract.getRootId throw the IllegalArgumentException. The solution is to check whether the uri is the root uri by using try catch IllegalArgumentException when it is calling DocumentsContract.getRootId. To add testcase for testing the solution. Fixes: 69887605 Test: atest DocumentsUITests Change-Id: I9ac4dd20d56b0cfb2ad71df487ec26de8168e6b0
Loading
Please register or sign in to comment