DataSource: consider content URI sources "binary" also

This commit is contained in:
Thialfihar 2010-12-25 14:12:12 +00:00
parent 428cf39ba3
commit ee1918b7c8

View File

@ -24,6 +24,8 @@ public class DataSource {
public void setUri(Uri uri) { public void setUri(Uri uri) {
mContentUri = uri; mContentUri = uri;
mText = null;
mData = null;
} }
public void setUri(String uri) { public void setUri(String uri) {
@ -37,11 +39,13 @@ public class DataSource {
public void setText(String text) { public void setText(String text) {
mText = text; mText = text;
mData = null; mData = null;
mContentUri = null;
} }
public void setData(byte[] data) { public void setData(byte[] data) {
mData = data; mData = data;
mText = null; mText = null;
mContentUri = null;
} }
public boolean isText() { public boolean isText() {
@ -49,7 +53,7 @@ public class DataSource {
} }
public boolean isBinary() { public boolean isBinary() {
return mData != null; return mData != null || mContentUri != null;
} }
public InputData getInputData(Context context, boolean withSize) public InputData getInputData(Context context, boolean withSize)