Skip to content

Conversation

haok1402
Copy link
Contributor

@haok1402 haok1402 commented Apr 8, 2025

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:

  • Previously, if KEY_WAITING_FOR_REBOOT was true inside the clickListener, the update check was ignored without notifying the user.
  • Now, an alert dialog is shown to inform the user that a reboot is required before another update check can be performed.

Testing:

Tested on Pixel 6a, 2025032100 release to ensure:

  • Update check works normally when no reboot is pending.
  • Alert dialog correctly appears when a reboot is required.
  • No regressions or unexpected behavior.

Screenshot from the testing can be found here.

Expected Behavior:

When the user checks for updates:

  • If no reboot is pending, the system initiates the update check.
  • If a reboot is pending, an alert dialog informs the user before proceeding.

I am happy to revise and resubmit the code if any changes are desired.

Resolves #101

@haok1402 haok1402 marked this pull request as ready for review April 8, 2025 01:47
…an update is already available and awaiting a reboot to complete installation.
@haok1402 haok1402 force-pushed the fix-pending-reboot branch from 18faa2f to 3046508 Compare April 11, 2025 02:14
@thestinger
Copy link
Member

@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.

@de0u
Copy link

de0u commented May 15, 2025

@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?

@thestinger
Copy link
Member

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.

@haok1402
Copy link
Contributor Author

@thestinger Thanks for the info! I'm interested and will start looking into it.

@haok1402
Copy link
Contributor Author

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?

@thestinger
Copy link
Member

Just as a new fully separate PR.

@haok1402
Copy link
Contributor Author

haok1402 commented May 27, 2025

I have an implementation that seems to work on the old release.
Planning to test on 2025052000 and submit the PR in the next few days.

@thestinger
Copy link
Member

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.

@thestinger
Copy link
Member

@haok1402 Can you rebase it instead of merging? git rebase upstream/16

@haok1402
Copy link
Contributor Author

@thestinger Yes, fixing it.

@haok1402 haok1402 force-pushed the fix-pending-reboot branch from 3821d98 to b6b5c42 Compare July 23, 2025 16:36
haok1402 and others added 7 commits July 23, 2025 12:44
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 haok1402 changed the base branch from 15-qpr2 to 16 September 24, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alert user of a pending update when “Check for updates” is pressed
3 participants