Download complete notification does not navigate to downloaded file when firefox is in the background
Categories
(Fenix :: Downloads, defect, P2)
Tracking
(firefox126 verified)
Tracking | Status | |
---|---|---|
firefox126 | --- | verified |
People
(Reporter: pollymce, Assigned: pollymce)
References
Details
(Whiteboard: [fxdroid] [group4])
Attachments
(3 files, 5 obsolete files)
This shows what happens when you tap a download complete notification from the home screen (nothing)
1.83 MB,
video/mp4
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
3.95 MB,
video/mp4
|
Details |
Steps to reproduce
- Open firefox and download any file
- Wait for download to complete
- Background firefox (eg. by pressing home button)
- Tap on Download Completed notification
Expected behavior
If an app has been set up to handle this file type, downloaded file is opened in that app
If not, a chooser menu is presented to select an app to open the download
Actual behavior
The file is not opened
An error appears in the log: Indirect notification activity start (trampoline) from org.mozilla.firefox blocked
Device information
- Firefox version: release build 123.1.0 / latest debug build
- Android device model: Pixel 8 / Samsung S24
- Android OS version: Android 14
Any additional information?
It looks like we are running into notification trampoline restrictions as described here: https://developer.android.com/about/versions/12/behavior-changes-12#notification-trampolines
We could fix this by launching an Activity directly rather than using a BroadcastReceiver and a Service to launch the Activity.
Assignee | ||
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Assignee | ||
Comment 1•10 months ago
|
||
Content intent of completed DownloadNotification now uses a PendingIntent which launches an Activity directly.
Previously, we launched the Activity indirectly from a BroadcastReceiver, which is less performant and is prohibited by the OS since Android 12.
The download notification test has been modified to mock out the file opening behaviour, as this test is just checking the visuals of the notification rather than the onward journeys.
Assignee | ||
Comment 2•10 months ago
|
||
Fix lint issues.
Assignee | ||
Comment 3•10 months ago
|
||
Add notification trampoline test case that fails before the fix was made & passes after, to cover this bug.
Assignee | ||
Comment 4•10 months ago
|
||
Fix more lint errors
Assignee | ||
Comment 5•10 months ago
|
||
Remove the ACTION_OPEN handling, logging and related messaging.
We are now sending the intent to open the file directly to the Android OS to handle, so none of this is required.
The telemetry wasn't being sent previously anyway because:
a) from what i can see in glean, these metrics have expired
b) this ACTION_OPEN code path hasn't been working since targetting android 12
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Assignee | ||
Updated•10 months ago
|
Assignee | ||
Comment 6•10 months ago
|
||
Remove the ACTION_OPEN handling, logging and related messaging.
We are now sending the intent to open the file directly to the Android OS to handle, so none of this is required.
The telemetry wasn't being sent previously anyway because:
a) from what i can see in glean, these metrics have expired
b) this ACTION_OPEN code path hasn't been working since targetting android 12
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Comment 8•10 months ago
•
|
||
Backed out for causing linting opt failures.
L.E. Please also check this.
Comment 10•10 months ago
|
||
Backed out for causing linting failures on AbstractFetchDownloadService.kt
- backout: https://hg.mozilla.org/integration/autoland/rev/28861b9f8a6f87eb7eaec9c3c307757e06646e9c
- push: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&selectedTaskRun=LrEgQ3jQTYCY2slkdec9cQ.0&revision=71c813e27dff32e4664eb9116e60097837485bfb
- failure log: https://treeherder.mozilla.org/logviewer?job_id=452130978&repo=autoland
[task 2024-03-25T10:09:15.394Z] > Task :detekt FAILED
[task 2024-03-25T10:09:15.394Z] /builds/worker/checkouts/gecko/mobile/android/android-components/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/AbstractFetchDownloadService.kt:988:13: The function createOpenFileIntent is missing documentation. [UndocumentedPublicFunction]
[task 2024-03-25T10:09:15.394Z]
[task 2024-03-25T10:09:15.394Z] /builds/worker/checkouts/gecko/mobile/android/android-components/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/AbstractFetchDownloadService.kt - 20min debt
[task 2024-03-25T10:09:15.394Z] UndocumentedPublicFunction - [The function createOpenFileIntent is missing documentation.] at /builds/worker/checkouts/gecko/mobile/android/android-components/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/AbstractFetchDownloadService.kt:988:13
[task 2024-03-25T10:09:15.394Z]
[task 2024-03-25T10:09:15.394Z] Overall debt: 20min
[task 2024-03-25T10:09:15.394Z]
[task 2024-03-25T10:09:15.394Z] comments - 20min debt
[task 2024-03-25T10:09:15.394Z] UndocumentedPublicFunction - [The function createOpenFileIntent is missing documentation.] at /builds/worker/checkouts/gecko/mobile/android/android-components/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/AbstractFetchDownloadService.kt:988:13
[task 2024-03-25T10:09:15.394Z]
Assignee | ||
Comment 11•10 months ago
|
||
sorry for breaking stuff! :(
i have now figured out which linters to run, fixed the errors and got a successful try https://treeherder.mozilla.org/jobs?repo=try&revision=b1d1fce9984a4da12ef6b1b07924cbc595280045
Comment 12•10 months ago
|
||
Comment 13•10 months ago
|
||
bugherder |
Assignee | ||
Updated•10 months ago
|
Comment 14•10 months ago
|
||
Comment 15•10 months ago
|
||
Verified as fixed on the latest Nightly - 126.0a1 from 27.03.2024 with Samsung Galaxy S23 Ultra (Android 14) and OnePlus A3000 (Android 6).
Description
•