This commit is contained in:
Arne 2023-10-23 21:57:36 +02:00
parent 6a24d2e54a
commit 9db893781a

View file

@ -2544,19 +2544,19 @@ public class ConversationFragment extends XmppFragment
public void attachFile(final int attachmentChoice, final boolean updateRecentlyUsed) {
if (attachmentChoice == ATTACHMENT_CHOICE_RECORD_VOICE) {
if ((!hasPermissions(attachmentChoice, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.RECORD_AUDIO) && !Compatibility.runsThirtyThree()) || (!hasPermissions(attachmentChoice, Manifest.permission.RECORD_AUDIO) && Compatibility.runsThirtyThree())) {
return;
return; // TODO: Request permissions directly here
}
} else if (attachmentChoice == ATTACHMENT_CHOICE_TAKE_PHOTO || attachmentChoice == ATTACHMENT_CHOICE_RECORD_VIDEO) {
if ((!hasPermissions(attachmentChoice, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.CAMERA) && !Compatibility.runsThirtyThree()) || (Compatibility.runsThirtyThree() && !hasPermissions(attachmentChoice, Manifest.permission.CAMERA))) {
return;
return; // TODO: Request permissions directly here
}
} else if (attachmentChoice == ATTACHMENT_CHOICE_LOCATION) {
if (!hasPermissions(attachmentChoice, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)) {
return;
return; // TODO: Request permissions directly here
}
} else if ((attachmentChoice == ATTACHMENT_CHOICE_CHOOSE_FILE || attachmentChoice == ATTACHMENT_CHOICE_CHOOSE_IMAGE || attachmentChoice == ATTACHMENT_CHOICE_CHOOSE_VIDEO) && !Compatibility.runsThirtyThree()) {
if (!hasPermissions(attachmentChoice, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE)) {
return;
return; // TODO: Request permissions directly here
}
}
if (updateRecentlyUsed) {