Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f794cc1f authored by cketti's avatar cketti
Browse files

Merge branch 'safe_content_resolver'

parents 15a44ce5 7560856d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ dependencies {
    compile 'de.cketti.library.changelog:ckchangelog:1.2.1'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.splitwise:tokenautocomplete:2.0.7'
    compile 'de.cketti.safecontentresolver:safe-content-resolver-v14:0.0.1'

    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'

+4 −1
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ import android.util.Log;
import com.fsck.k9.K9;
import com.fsck.k9.activity.misc.Attachment;

import de.cketti.safecontentresolver.SafeContentResolver;
import de.cketti.safecontentresolver.SafeContentResolverCompat;
import org.apache.commons.io.IOUtils;

/**
@@ -52,7 +54,8 @@ public class AttachmentContentLoader extends AsyncTaskLoader<Attachment> {
                Log.v(K9.LOG_TAG, "Saving attachment to " + file.getAbsolutePath());
            }

            InputStream in = context.getContentResolver().openInputStream(mAttachment.uri);
            SafeContentResolver safeContentResolver = SafeContentResolverCompat.newInstance(context);
            InputStream in = safeContentResolver.openInputStream(mAttachment.uri);
            try {
                FileOutputStream out = new FileOutputStream(file);
                try {