Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ec40c5c0 authored by felkachang's avatar felkachang Committed by Felka Chang
Browse files

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
parent 0af43022
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment