Skip to content

fix: resolve #974 — 使用tinker1.9.9,线上修复成功率60%#1800

Open
Nam0101 wants to merge 1 commit into
Tencent:devfrom
Nam0101:contribai/feat/ensure-the-foreground-service-used-by-th
Open

fix: resolve #974 — 使用tinker1.9.9,线上修复成功率60%#1800
Nam0101 wants to merge 1 commit into
Tencent:devfrom
Nam0101:contribai/feat/ensure-the-foreground-service-used-by-th

Conversation

@Nam0101
Copy link
Copy Markdown

@Nam0101 Nam0101 commented May 16, 2026

Summary

fix: resolve #974 — 使用tinker1.9.9,线上修复成功率60%

Problem

Severity: High | File: tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/service/TinkerPatchForegroundService.java

A second very common 1.9.9 failure mode is Context.startForegroundService() followed by a missing or delayed startForeground() call inside the service, which on API 26+ produces a ForegroundServiceDidNotStartInTimeException (5 second window) and silently kills the patch process. That kill is recorded by Tinker as "patch process exit abnormally" and counts as a failure. Combined with the JobService scheduling issues, this can easily account for the 30+% drop.

Solution

Changes

  • tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/service/TinkerPatchForegroundService.java (new)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

Note: this change was drafted with AI assistance and reviewed locally before submission.

Fixes Tencent#974

Signed-off-by: Nguyen Van Nam <nam.nv205106@gmail.com>
@tencent-adm
Copy link
Copy Markdown
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

使用tinker1.9.9,线上修复成功率60%

2 participants