allow deletion of all files
This commit is contained in:
parent
ceceead505
commit
56f01c29b9
|
@ -362,8 +362,12 @@ public class FileBackend {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean weOwnFileLollipop(final Uri uri) {
|
private static boolean weOwnFileLollipop(final Uri uri) {
|
||||||
|
final String path = uri.getPath();
|
||||||
|
if (path == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
File file = new File(uri.getPath());
|
File file = new File(path);
|
||||||
FileDescriptor fd =
|
FileDescriptor fd =
|
||||||
ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY)
|
ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY)
|
||||||
.getFileDescriptor();
|
.getFileDescriptor();
|
||||||
|
|
|
@ -1184,12 +1184,9 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
||||||
cancelTransmission.setVisible(true);
|
cancelTransmission.setVisible(true);
|
||||||
}
|
}
|
||||||
if (m.isFileOrImage() && !deleted && !cancelable) {
|
if (m.isFileOrImage() && !deleted && !cancelable) {
|
||||||
final String path = m.getRelativeFilePath();
|
|
||||||
if (path == null || !path.startsWith("/")) {
|
|
||||||
deleteFile.setVisible(true);
|
deleteFile.setVisible(true);
|
||||||
deleteFile.setTitle(activity.getString(R.string.delete_x_file, UIHelper.getFileDescriptionString(activity, m)));
|
deleteFile.setTitle(activity.getString(R.string.delete_x_file, UIHelper.getFileDescriptionString(activity, m)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (showError) {
|
if (showError) {
|
||||||
showErrorMessage.setVisible(true);
|
showErrorMessage.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue