Skip to content

fix: resolve #1078 — TinkerPatchService 的 JobID 可以让用户自己配置吗? - #1793

Open
Nam0101 wants to merge 2 commits into
Tencent:devfrom
Nam0101:contribai/feat/make-tinkerpatchservice-jobid-configurab
Open

fix: resolve #1078 — TinkerPatchService 的 JobID 可以让用户自己配置吗?#1793
Nam0101 wants to merge 2 commits into
Tencent:devfrom
Nam0101:contribai/feat/make-tinkerpatchservice-jobid-configurab

Conversation

@Nam0101

@Nam0101 Nam0101 commented May 16, 2026

Copy link
Copy Markdown

Summary

fix: resolve #1078 — TinkerPatchService 的 JobID 可以让用户自己配置吗?

Problem

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

TinkerPatchService currently uses a hardcoded JobID (typically a constant like JOB_ID = -1119860829 or similar) when scheduling its background patch job via JobScheduler on Android L+. Since JobScheduler IDs share a single namespace per application, a hardcoded value risks colliding with JobIDs registered by the host app or other libraries. The fix is to expose the JobID as a configurable value with a sensible default, while keeping backward compatibility.

Solution

Locate the JobID constant inside TinkerPatchService.java. It is typically declared as something like:

Changes

  • tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/service/TinkerPatchService.java (modified)
  • tinker-android/tinker-android-lib-no-op/src/main/java/com/tencent/tinker/lib/service/TinkerPatchService.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.

@tencent-adm

tencent-adm commented May 16, 2026

Copy link
Copy Markdown
Member

CLA assistant check
All committers have signed the CLA.

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.

TinkerPatchService 的 JobID 可以让用户自己配置吗?

2 participants