allow app to query for apps that can resolve VIEW or SEND intents

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2021-11-11 11:22:37 +01:00
parent 6f206aa5b8
commit 40506eaeaf
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
2 changed files with 12 additions and 3 deletions

View File

@ -192,4 +192,16 @@
</provider> </provider>
</application> </application>
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:mimeType="*/*" />
</intent>
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>
</manifest> </manifest>

View File

@ -371,9 +371,6 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
File file = new File(path); File file = new File(path);
Intent intent = new Intent(Intent.ACTION_VIEW); Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), mimetype); intent.setDataAndType(Uri.fromFile(file), mimetype);
// TODO resolveActivity might need more permissions starting with android 11 (api 30)
// https://developer.android.com/about/versions/11/privacy/package-visibility
return intent.resolveActivity(context.getPackageManager()) != null; return intent.resolveActivity(context.getPackageManager()) != null;
} }