• Michael Thiessen's avatar
    Remove BROWSABLE category from content URI intent filters · f10e7b2e
    Michael Thiessen authored
    Chrome does not allow sites to navigate to content URIs, but the Google
    Search app parses and re-sends URIs, including content URIs, sent to it.
    This allows intents sent to GSA to bypass this content URI restriction.
    
    In order to prevent this bypass, we can simply remove the BROWSABLE
    category from our intent filters that handle content URIs, as we don't
    need to handle content URIs coming from other browsers.
    
    This change also adds tests for our Intent Filters, which, as far as I
    can tell, were untested before this change. I also fixed a few edge
    cases with the intent filters I modified as revealed by the tests.
    
    Note that for some intent filters I removed the content scheme
    altogether. In these cases the filter wasn't useful because a file
    extension was specified, making it impossible for the content scheme to
    be matched.
    
    I also suppressed some AppLinkUrlErrors: "Error: Activity supporting
    ACTION_VIEW is not set as BROWSABLE". This isn't an error. I don't know
    why lint flags it other than to make sure you know what you're doing and
    don't accidentally prevent browsers from launching your View intent
    Activity.
    
    Bug: 1092453
    Change-Id: I167d2e41c0d9c75c0b80a5a1778817b42016e21b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2321522
    Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
    Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
    Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
    Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#796040}
    f10e7b2e
trichrome_chrome_bundle.AndroidManifest.expected 77.4 KB