Fixed deprecations#592
Merged
Merged
Conversation
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses two deprecations by updating call sites to use non-deprecated overloads.
- Switches to the new
CancellableContinuation.resumeoverload with a three-parameter cancellation lambda. - Replaces deprecated
Intent.getSerializableExtrawithIntentCompat.getSerializableExtra. - Adds necessary imports for
IntentCompatand companion constants.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/src/main/java/at/bitfire/icsdroid/ui/views/CalendarListActivity.kt | Replaced getSerializableExtra call with IntentCompat.getSerializableExtra, imported IntentCompat and companion constants. |
| app/src/main/java/at/bitfire/icsdroid/AsyncUtils.kt | Updated resume call to the new overload signature using a three-argument cancellation lambda. |
Comments suppressed due to low confidence (2)
app/src/main/java/at/bitfire/icsdroid/ui/views/CalendarListActivity.kt:24
- [nitpick] The explicit import of companion object members can be removed, since Kotlin allows direct access to
EXTRA_ERROR_MESSAGEandEXTRA_THROWABLEwithout importing them.
import at.bitfire.icsdroid.ui.views.CalendarListActivity.Companion.EXTRA_ERROR_MESSAGE
app/src/main/java/at/bitfire/icsdroid/AsyncUtils.kt:29
- [nitpick] Consider using
continuation.invokeOnCancellation { call.cancel() }before enqueueing. This separates cancellation handling from the resume logic and avoids the less-readable multi-parameter lambda onresume.
continuation.resume(value = response, onCancellation = { _, _, _ -> call.cancel() })
sunkup
approved these changes
Jun 11, 2025
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.
Purpose
Fixed two small deprecations.
Short description
CancellableContinuation.resumeoverload that takes more arguments inonCancellation.IntentCompat.getSerializableExtrainstead of the deprecatedIntent.getSerializableExtra.Checklist