Skip to content

fix: resolve #1114 — 1.9.13在android 26(含)以上无法合成补丁#1798

Open
Nam0101 wants to merge 3 commits into
Tencent:devfrom
Nam0101:contribai/feat/run-patch-service-as-foreground-service-
Open

fix: resolve #1114 — 1.9.13在android 26(含)以上无法合成补丁#1798
Nam0101 wants to merge 3 commits into
Tencent:devfrom
Nam0101:contribai/feat/run-patch-service-as-foreground-service-

Conversation

@Nam0101
Copy link
Copy Markdown

@Nam0101 Nam0101 commented May 16, 2026

Summary

fix: resolve #1114 — 1.9.13在android 26(含)以上无法合成补丁

Problem

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

On Android 26+, Tinker 1.9.13 dispatches patch work through JobIntentService, which sits on top of JobScheduler. JobScheduler does not guarantee timely execution of jobs scheduled while the app is in background, and several OEM ROMs (MIUI, EMUI, ColorOS, etc.) refuse to dispatch jobs at all unless the app has "auto-start" permission. This matches the user's observation that the patch silently never starts unless auto-start is granted. The fix is to keep using a regular IntentService/Service and promote it to a foreground service via startForegroundService + startForeground on API 26+, so the OS allows it to run regardless of background state. The notification used by startForeground should be customizable by the host app so it does not surprise end users.

Solution

Changes

  • tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/service/TinkerPatchService.java (modified)
  • tinker-android/tinker-android-lib/src/main/AndroidManifest.xml (modified)
  • tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/service/DefaultTinkerResultService.java (modified)

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.

Nam0101 added 3 commits May 17, 2026 04:30
Fixes Tencent#1114

Signed-off-by: Nguyen Van Nam <nam.nv205106@gmail.com>
Fixes Tencent#1114

Signed-off-by: Nguyen Van Nam <nam.nv205106@gmail.com>
Fixes Tencent#1114

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.

1.9.13在android 26(含)以上无法合成补丁

2 participants