Add necessary cross-profile checks for PhotoPicker
Device admins can regulate/restrict which intents show cross-profile
contents. Add a check in the PhotoPicker activity to check device admin
policies for cross-profile content.
Note: This check does not affect the visibility of "Work", "Personal"
tabs (and/or other UI to show the 2 profile contents). We need to give
user an informative error message as to why they cannot view the other
profile contents (even though the other profile exists).
Add checks to know if Work profile is paused (turned off through the
toggle).
Add crossProfile to true in AndroidManifest as that is essential for
resolution of the intent. This is because MediaProvider in both the
profiles are now default resolver for the activity.
Bug: 190733134
Test: manual
Change-Id: I146ecd1cc1a1ab28a15598eb2fd8b1108b8de7e9
Merged-In: I146ecd1cc1a1ab28a15598eb2fd8b1108b8de7e9
(cherry picked from commit 0710aea7a052c4e298e537b00dcbebf752f33f49)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 0470099..85f2aa5 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -44,7 +44,8 @@
android:allowBackup="false"
android:supportsRtl="true"
android:forceQueryable="true"
- android:usesCleartextTraffic="true">
+ android:usesCleartextTraffic="true"
+ android:crossProfile="true">
<provider
android:name="com.android.providers.media.MediaProvider"
android:authorities="media"