Fixes type resolving in ActivityManagerShellCommand
- There are 2 reasons for this change
1. make it non-async, because the type may still be null while it's being used in the below codes
2. Ams.mimeTypeFilterAsync is now used only when the caller does not hold the permission. So replacing it with ContentResolver.getType
- Also granting shell special permission to access all provider mime types.
Bug: b/284407686
Test: The intended behavior was reproduced on local testing.
Change-Id: I9add06ffe8c0e7c185f0947f0695be259513bd13
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 43f98c3..56e0643 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -839,6 +839,8 @@
<uses-permission android:name="android.permission.LAUNCH_CREDENTIAL_SELECTOR" />
<!-- Permission required for CTS test IntentRedirectionTest -->
<uses-permission android:name="android.permission.QUERY_CLONED_APPS" />
+ <!-- Permission required for accessing all content provider mime types -->
+ <uses-permission android:name="android.permission.GET_ANY_PROVIDER_TYPE" />
<application
android:label="@string/app_label"