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

Commit 98bc797d authored by Tomasz Mikolajewski's avatar Tomasz Mikolajewski Committed by Android (Google) Code Review
Browse files

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

parents 69c8cc29 c2b1237c
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);