fix: resolve #1078 — TinkerPatchService 的 JobID 可以让用户自己配置吗?#1793
Open
Nam0101 wants to merge 2 commits into
Open
fix: resolve #1078 — TinkerPatchService 的 JobID 可以让用户自己配置吗?#1793Nam0101 wants to merge 2 commits into
Nam0101 wants to merge 2 commits into
Conversation
Fixes Tencent#1078 Signed-off-by: Nguyen Van Nam <nam.nv205106@gmail.com>
Fixes Tencent#1078 Signed-off-by: Nguyen Van Nam <nam.nv205106@gmail.com>
Member
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix: resolve #1078 — TinkerPatchService 的 JobID 可以让用户自己配置吗?
Problem
Severity:
Medium| File:tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/service/TinkerPatchService.javaTinkerPatchService currently uses a hardcoded JobID (typically a constant like
JOB_ID = -1119860829or 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
Note: this change was drafted with AI assistance and reviewed locally before submission.