[Bug] Crash when downloading file with a period in the name #16443
Description
Steps to reproduce
Download a file that has two consecutive periods as part of the filename
Expected behavior
The browser doesn't crash.
Actual behavior
The file is downloaded, but the browser crashes. Stacktrace:
d41c7934-4f47-436c-bf2e-eb29011bedce
java.lang.IllegalArgumentException: Invalid file path: /storage/emulated/0/Download/o..txt
java.lang.IllegalArgumentException: Invalid file path: /storage/emulated/0/Download/o..txt
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:170)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:481)
at android.content.ContentResolver.insert(ContentResolver.java:1844)
at android.app.DownloadManager.addCompletedDownload(DownloadManager.java:1530)
at android.app.DownloadManager.addCompletedDownload(DownloadManager.java:1446)
at mozilla.components.feature.downloads.AbstractFetchDownloadService.updateDownloadNotification$feature_downloads_release(AbstractFetchDownloadService.kt:21)
at mozilla.components.feature.downloads.AbstractFetchDownloadService.access$updateDownloadNotification(AbstractFetchDownloadService.kt:5)
at mozilla.components.feature.downloads.AbstractFetchDownloadService$onStartCommand$2.invokeSuspend(AbstractFetchDownloadService.kt:7)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:3)
at kotlinx.coroutines.AwaitKt.resume(Await.kt:7)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:18)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:5)
at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:2)
at kotlinx.coroutines.android.HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1.run(Runnable.kt:1)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8347)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
Device information
- Android device: Huawei Nova 6 (Android 10)
- Fenix version: Nightly 201106 17:01 (Build #2015774091)
┆Issue is synchronized with this Jira Task