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

Commit ffd694a9 authored by Tomasz Mikolajewski's avatar Tomasz Mikolajewski
Browse files

Do not launch a quick viewer unless it's whitelisted.

Bug: 26697917
Change-Id: Ibe2c7c462380c219d6ce5b5c69af6dac0df62d41
parent 063a0f38
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -72,18 +72,12 @@ final class QuickViewIntentBuilder {

        String trustedPkg = mResources.getString(R.string.trusted_quick_viewer_package);

        if (!TextUtils.isEmpty(trustedPkg)) {
            Intent intent = new Intent(Intent.ACTION_QUICK_VIEW);
            intent.setDataAndType(mDocument.derivedUri, mDocument.mimeType);
            intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

        if (TextUtils.isEmpty(trustedPkg)) {
            if (hasRegisteredHandler(intent)) {
                return intent;
            }
        } else {
            intent.setPackage(trustedPkg);
            if (hasRegisteredHandler(intent)) {
                // We have a trusted handler. Load all of the docs into the intent.
                Cursor cursor = mSiblings.getCursor();
                for (int i = 0; i < cursor.getCount(); i++) {
                    onNextItem(i, cursor);