am 6c15188a
: Merge "Close body input streams" into ub-mail-master
* commit '6c15188a9ec334e0c1ea892852060b8360926300': Close body input streams
This commit is contained in:
commit
6b8902c078
@ -70,7 +70,12 @@ public class EmailMessageCursor extends CursorWrapper {
|
||||
if (mHtmlColumnIndex != -1) {
|
||||
final Uri htmlUri = Body.getBodyHtmlUriForMessageWithId(messageId);
|
||||
final InputStream in = cr.openInputStream(htmlUri);
|
||||
final String underlyingHtmlString = IOUtils.toString(in);
|
||||
final String underlyingHtmlString;
|
||||
try {
|
||||
underlyingHtmlString = IOUtils.toString(in);
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
final String sanitizedHtml = HtmlSanitizer.sanitizeHtml(underlyingHtmlString);
|
||||
mHtmlParts.put(position, sanitizedHtml);
|
||||
}
|
||||
@ -81,7 +86,12 @@ public class EmailMessageCursor extends CursorWrapper {
|
||||
if (mTextColumnIndex != -1) {
|
||||
final Uri textUri = Body.getBodyTextUriForMessageWithId(messageId);
|
||||
final InputStream in = cr.openInputStream(textUri);
|
||||
final String underlyingTextString = IOUtils.toString(in);
|
||||
final String underlyingTextString;
|
||||
try {
|
||||
underlyingTextString = IOUtils.toString(in);
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
mTextParts.put(position, underlyingTextString);
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user