Alert User of Pending Reboot When Manual Update Check Is Blocked#102
Alert User of Pending Reboot When Manual Update Check Is Blocked#102haok1402 wants to merge 11 commits intoGrapheneOS:16from
Conversation
…an update is already available and awaiting a reboot to complete installation.
18faa2f to
3046508
Compare
|
@haok1402 It would be very helpful to prevent fully disabling System Updater notifications and reboot notifications while still allowing explicitly disabling the others (disabling errors is sketchy but it would need to support automatically retrying before reporting errors at least for automatic updates prior to prevent disabling it). This is done for some other system app notifications but these are easily the most important and should be done for it too. It seems many users try to disable the Already up-to-date notifications or the progress notification and accidentally end up disabling all of them instead. |
|
@thestinger I believe @haok1402 is traveling and may not be able to respond for a few days. Meanwhile, is it easy to indicate one of the system apps that currently prevents notification disabling? |
|
It's done for GmsCompat. I'm not sure exactly where. I think there are cases where overall notifications can't be disabled but specific channels can be disabled. |
|
@thestinger Thanks for the info! I'm interested and will start looking into it. |
|
I've investigated how GmsCompat handles this and confirmed that it uses fixed notifications, with certain channels marked as blockable — users can't disable notifications entirely but a few specific channels. Based on that, I plan to make and test similar changes to System Updater: mark its notifications as fixed and set the reboot channel as non-blockable. @thestinger Would you prefer these changes as part of this PR (to retain the current discussion/context), or submitted in a new PR that references this one? |
|
Just as a new fully separate PR. |
|
I have an implementation that seems to work on the old release. |
|
This might still be useful since I think there are still ways to clear away the reboot notification despite it being marked persistent, the permission being marked fixed and the channel not being opted into being blockable. |
cddb120 to
0e93954
Compare
|
@haok1402 Can you rebase it instead of merging? |
|
@thestinger Yes, fixing it. |
3821d98 to
b6b5c42
Compare
Statically grant Updater permission for "fixed" notifications; set most notifications to be blockable by users, but set notifications on the REBOOT channel to be non-blockable. Some users have gotten "stuck" by disabling the notification to reboot the system to install a new release. Updater can't download and prepare a later release until the previously-prepared release has been installed, so it is important to avoid losing the please-reboot notification.
This worked as intended for most users but caused an unexpected issue blocking changing all of the notification channels for several users. This reverts commit 4e69487.
|
@haok1402 Needs to be rebased again. |
|
@thestinger Sorry, my bad; I thought the GitHub button can do the trick; Let me pull down and run the rebase. |
|
@thestinger I believe @haok1402 will also be re-testing. If either of you can flip the PR back to "draft", that might be appropriate? |
|
We did successfully ship a variant of @haok1402's earlier changes making the notification channels fixed, so that's good. I considered that a lot more important. We also got rid of the 3 day timeout introduced with Android 15 QPR1. There are still some other issues such as what happens if an update check occurs in early boot after an existing update is having post-boot code run, which should just delay doing the new update until that finishes. |
|
@thestinger Two questions...
|
|
@de0u This would still be useful because the notification can still be lost including via Do Not Disturb. |
|
It would probably good if the app had a generic status display in the settings. |
Yes, but note it's not the app optimization which is relevant. The app optimization is our own thing unrelated to update_engine. The issue is that it seems update_engine does some post-update work which can sometimes take longer than it used to and opens up a real window where weird behavior can happen because our app both gets an error but also gets progress updates and then thinks the update finished when the post-update stuff from what it was already doing is done. |
|
In that case, it asks people to reboot to update, when it's for the last update which was doing post-boot work, and it has deleted the downloaded update from the error. After people reboot, it has to do it again. |
Description:
This PR improves the system updater by notifying users when they attempt a manual update check while an update is already prepared and awaiting a reboot. Instead of ignoring the user’s tap on the “Check for updates” button, the system now displays an alert, prompting the user to reboot.
Due to the critical nature of System Updater, this proposed change is the smallest imagined code change. If desired, it could be expanded on. For example, it would be possible to store the build number of the pending update and include that in the displayed alert.
Changes:
KEY_WAITING_FOR_REBOOTwastrueinside theclickListener, the update check was ignored without notifying the user.Testing:
Tested on Pixel 6a, 2025032100 release to ensure:
Screenshot from the testing can be found here.
Expected Behavior:
When the user checks for updates:
I am happy to revise and resubmit the code if any changes are desired.
Resolves #101