Remove the userId before doing authority check in case of cross-profiles uri checks
This is a bug we encountered while trying to delete a document inside the main user from the private space user using DocumentsContract#deleteDocument. We were using ACTION_OPEN_DOCUMENT to launch the DocsUI and the returned uris have userId prefix attached to them; i.e. “0@com.android.providers.media.documents”. This userId prefix result in authority mismatch exception: "java.lang.SecurityException: Requested authority 0@com.android.providers.media.documents doesn't match provider com.android.providers.media.documents” This cl removes the userId before doing the authority check. This is already being done in the base ContentProvider class https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:frameworks/base/core/java/android/content/ContentProvider.java;drc=1eb58995aeeb8c266f72cd37eed4044d56ea2f20;l=2757 Bug: 394024051 Flag: EXEMPT minor fix Change-Id: Ieaeb20cadad68292e8a46fbce5b32e58c6b4d337
Loading
Please register or sign in to comment