|
@@ -281,12 +281,14 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private boolean canBeHandledByExternalApp(String mimetype, String fileName){
|
|
|
+ private boolean canBeHandledByExternalApp(String mimetype, String fileName) {
|
|
|
String path = context.getCacheDir().getAbsolutePath() + "/" + fileName;
|
|
|
File file = new File(path);
|
|
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
|
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;
|
|
|
}
|
|
|
|