tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit ab5bf2401717970560597083d6ac72915bde2d89
parent 52d98a0908a25c0a60220529b2eaa7f88724a248
Author: Atila Butkovits <abutkovits@mozilla.com>
Date:   Thu,  9 Oct 2025 22:56:38 +0300

Revert "Bug 1975933 - Ask and show camera/microphone picker when accept attribute is empty r=android-reviewers,nalexander" for causing failures at handleFilePickerRequest.

This reverts commit dcf798ed06da5f3d512373f750e5f0adc1bd557d.

Diffstat:
Mmobile/android/android-components/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/file/MimeType.kt | 4++--
Mmobile/android/android-components/components/feature/prompts/src/test/java/mozilla/components/feature/prompts/file/MimeTypeTest.kt | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mobile/android/android-components/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/file/MimeType.kt b/mobile/android/android-components/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/file/MimeType.kt @@ -135,10 +135,10 @@ internal sealed class MimeType( /** * True if any of the given mime values match this type. If no values are specified, then - * it will match any mime type. + * there will not be a match. */ open fun matches(mimeTypes: Array<out String>) = - mimeTypes.isEmpty() || mimeTypes.any { it.startsWith(type) } + mimeTypes.isNotEmpty() && mimeTypes.any { it.startsWith(type) } open fun shouldCapture(mimeTypes: Array<out String>, capture: File.FacingMode) = capture != File.FacingMode.NONE && diff --git a/mobile/android/android-components/components/feature/prompts/src/test/java/mozilla/components/feature/prompts/file/MimeTypeTest.kt b/mobile/android/android-components/components/feature/prompts/src/test/java/mozilla/components/feature/prompts/file/MimeTypeTest.kt @@ -64,7 +64,7 @@ class MimeTypeTest { @Test fun `matches empty list of mime types`() { - assertTypes(setOf(MimeType.Image(), MimeType.Audio, MimeType.Video, MimeType.Wildcard)) { + assertTypes(setOf(MimeType.Wildcard)) { it.matches(emptyArray()) } }