Explorar el Código

add info about permissions on api level 30 for resolveActivity

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe hace 4 años
padre
commit
5914f01524

+ 3 - 1
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java

@@ -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;
     }