fix(Android): remove invalid onTimeout(int, int) override incompatible with compileSdk 34#267
Open
dmfdiogo wants to merge 1 commit into
Open
Conversation
…e with compileSdk 34 The two-argument onTimeout(int startId, int fgsType) overload was introduced in Android API 35 (VANILLA_ICE_CREAM). Using @OverRide against compileSdkVersion 34 causes a compile error because the method does not exist in the base Service class. Remove the overload and rely on the existing onTimeout(int startId) to call stopSelf(startId), which provides the same behaviour across all supported API levels.
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.
Problem
The two-argument
onTimeout(int startId, int fgsType)overload was introducedin Android API 35 (VANILLA_ICE_CREAM). Using
@Overrideagainst the defaultcompileSdkVersion 34causes a compile error — the method does not exist inthe base
android.app.Serviceclass at that API level.Fix
Remove the API-35-only overload. The existing
onTimeout(int startId)alreadycalls
stopSelf(startId), which is sufficient to stop the service on allsupported API levels.