Provide better 'why' when an attachment is not auto-downloaded.

This commit is contained in:
Cody Henthorne
2023-06-21 16:18:16 -04:00
parent 882748f080
commit df8aaa2005
2 changed files with 21 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ public class AttachmentUtil {
}
if (!isFromTrustedConversation(context, attachment)) {
Log.w(TAG, "Not allowing download due to untrusted conversation");
return false;
}
@@ -45,11 +46,23 @@ public class AttachmentUtil {
{
return true;
} else if (attachment.isVideoGif()) {
return NotInCallConstraint.isNotInConnectedCall() && allowedTypes.contains("image");
boolean allowed = NotInCallConstraint.isNotInConnectedCall() && allowedTypes.contains("image");
if (!allowed) {
Log.w(TAG, "Not auto downloading. inCall: " + NotInCallConstraint.isNotInConnectedCall() + " allowedType: " + allowedTypes.contains("image"));
}
return allowed;
} else if (isNonDocumentType(contentType)) {
return NotInCallConstraint.isNotInConnectedCall() && allowedTypes.contains(MediaUtil.getDiscreteMimeType(contentType));
boolean allowed = NotInCallConstraint.isNotInConnectedCall() && allowedTypes.contains(MediaUtil.getDiscreteMimeType(contentType));
if (!allowed) {
Log.w(TAG, "Not auto downloading. inCall: " + NotInCallConstraint.isNotInConnectedCall() + " allowedType: " + allowedTypes.contains(MediaUtil.getDiscreteMimeType(contentType)));
}
return allowed;
} else {
return NotInCallConstraint.isNotInConnectedCall() && allowedTypes.contains("documents");
boolean allowed = NotInCallConstraint.isNotInConnectedCall() && allowedTypes.contains("documents");
if (!allowed) {
Log.w(TAG, "Not auto downloading. inCall: " + NotInCallConstraint.isNotInConnectedCall() + " allowedType: " + allowedTypes.contains("documents"));
}
return allowed;
}
}