Fix up content URI for different users
Currently Commit Content API work only when the content URI provided by the IME is accessible to the target application. This is non-trivial if the target application is running as a different user (profile) and it is actually a possible scenario when managed profile is enabled. This CL takes care of such a situation, by fixing up the content URI when and only when InputContentInfo#getContentUri() is called from a different user than the owner of the content URI. This CL also makes it clear that we currently do not support content URIs that already have embedded user IDs. Since IActivityManager#grantUriPermissionFromOwner() does not support such URIs, we should have had a special handling for such a case, which will be addressed in a subsequent CL. Bug: 32427307 Bug: 32778718 Test: Made sure that Commit Content API works as expected on a managed profile created by https://github.com/googlesamples/android-testdpc Change-Id: I19d87fc19beea248f49b59ec5a5711b95bcbb466
Loading
Please register or sign in to comment