Annotate methods in AttachmentUtil as @WorkerThread.

This commit is contained in:
Greyson Parrelli 2018-06-11 11:08:25 -07:00
parent e45a4b86d8
commit 44f5cc9070
1 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,7 @@ public class AttachmentUtil {
private static final String TAG = AttachmentUtil.class.getSimpleName();
@WorkerThread
public static boolean isAutoDownloadPermitted(@NonNull Context context, @Nullable DatabaseAttachment attachment) {
if (attachment == null) {
Log.w(TAG, "attachment was null, returning vacuous true");
@ -100,6 +101,7 @@ public class AttachmentUtil {
return info != null && info.isConnected() && info.isRoaming() && info.getType() == ConnectivityManager.TYPE_MOBILE;
}
@WorkerThread
private static boolean isFromUnknownContact(@NonNull Context context, @NonNull DatabaseAttachment attachment) {
try (Cursor messageCursor = DatabaseFactory.getMmsDatabase(context).getMessage(attachment.getMmsId())) {
final MessageRecord message = DatabaseFactory.getMmsDatabase(context).readerFor(messageCursor).getNext();