mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
Merge branch 'fix_openOutputStream' into 'master'
Fix usage of ContentResolver.openOutputStream() See merge request briar/briar!1607
This commit is contained in:
@@ -39,6 +39,6 @@ class AndroidRemovableDrivePlugin extends RemovableDrivePlugin {
|
|||||||
OutputStream openOutputStream(TransportProperties p) throws IOException {
|
OutputStream openOutputStream(TransportProperties p) throws IOException {
|
||||||
String uri = p.get(PROP_URI);
|
String uri = p.get(PROP_URI);
|
||||||
if (isNullOrEmpty(uri)) throw new IllegalArgumentException();
|
if (isNullOrEmpty(uri)) throw new IllegalArgumentException();
|
||||||
return app.getContentResolver().openOutputStream(Uri.parse(uri));
|
return app.getContentResolver().openOutputStream(Uri.parse(uri), "wt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.briarproject.briar.android.conversation;
|
package org.briarproject.briar.android.conversation;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.content.ContentResolver;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -249,8 +250,8 @@ public class ImageViewModel extends DbViewModel implements EventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private OutputStream getOutputStream(Uri uri) throws IOException {
|
private OutputStream getOutputStream(Uri uri) throws IOException {
|
||||||
OutputStream os =
|
ContentResolver contentResolver = getApplication().getContentResolver();
|
||||||
getApplication().getContentResolver().openOutputStream(uri);
|
OutputStream os = contentResolver.openOutputStream(uri, "wt");
|
||||||
if (os == null) throw new IOException();
|
if (os == null) throw new IOException();
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user