Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch DirectBootMigrationService to a background service #577

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

chenxiaolong
Copy link
Owner

There seem to be two issues with the foreground service:

  • Some Android builds seem to be broken and throw a ForegroundServiceDidNotStartInTimeException even though the service unconditionally calls startForeground() in onStartCommand(). The root cause of this is unknown. Perhaps these devices are exceptionally slow during boot?
  • The persistent notification does not get dismissed when the file migration runs too quickly.

We may be able to work around the second issue by not setting the FOREGROUND_SERVICE_IMMEDIATE notification behavior flag, but given how fast the file migration is, let's just switch to a background service. We're unlikely to hit Android's limitations on background services.

Closes: #574
Closes: #576

There seem to be two issues with the foreground service:

* Some Android builds seem to be broken and throw a
  ForegroundServiceDidNotStartInTimeException even though the service
  unconditionally calls startForeground() in onStartCommand(). The root
  cause of this is unknown. Perhaps these devices are exceptionally slow
  during boot?
* The persistent notification does not get dismissed when the file
  migration runs too quickly.

We may be able to work around the second issue by not setting the
FOREGROUND_SERVICE_IMMEDIATE notification behavior flag, but given how
fast the file migration is, let's just switch to a background service.
We're unlikely to hit Android's limitations on background services.

Closes: #574
Closes: #576

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
@chenxiaolong chenxiaolong self-assigned this Aug 2, 2024
@chenxiaolong chenxiaolong merged commit 17f6d19 into master Aug 2, 2024
1 check passed
chenxiaolong added a commit that referenced this pull request Aug 2, 2024
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
@chenxiaolong chenxiaolong deleted the direct-boot branch August 2, 2024 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant