Repository navigation
fix: the save toast, the session's names, and a shared-media read - #512
Merged
Merged
Conversation
Four things CodeQL found on Develop, three of them real: - Saving an attachment showed nothing. The outcome was worked out into a `message` and then dropped: a save that wrote the file and one that failed looked identical. It is shown now. - `LockSession.lock()`/`unlock()` are a process-wide boolean, not a lock, but the names read as one to any tool that looks for a critical section — CodeQL reported the debug probe's `lock()` as an unreleased lock on a flag that is meant to stay set. Renamed to `clear()`/`grant()`, which is what they do. The probe's intent extras are unchanged. - An unused `colorScheme` in the video player dialog is gone. - The shared-media read uses `IntentCompat` instead of the getters deprecated from API 33, which also removes the `@Suppress` it needed. The rest of the open alerts are API-level compat calls (MediaRecorder's no-arg constructor, CarrierConfig's one-argument getter, SubscriptionInfo's number, bubbles) that have no non-deprecated path at minSdk 29, and three `$stable` fields generated by the Compose compiler shadowing each other. Those need a dismissal or a query filter, not a code change. JUnit: AttachmentSaveFeedbackTest (the save shows its outcome) and a LockSessionTest case holding the session's API to the names that describe it, so the false positive cannot come back.
2 tasks done
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.
What changed
Four things from the code-scanning page, three of them real bugs:
messageand then dropped — a save that wrote the file and one that failed looked identical to the user. CodeQL's "Unread local variable" was right. It is shown now.LockSession.lock()/unlock()are a process-wide boolean, not a lock, but the names read as one to any tool that looks for a critical section: CodeQL reported the debug probe'slock()as an unreleased lock on a flag that is meant to stay set. Renamed toclear()/grant(), which is what they do. The probe's intent extras are unchanged, so the app-lock scripts keep working.colorSchemein the video player dialog is gone.IntentCompatinstead of the getters deprecated from API 33 — which also removes the@Suppress("DEPRECATION")it needed.Why the other eleven are not code changes
MediaRecorder()(the Context constructor is API 31+),CarrierConfigManager.getConfigForSubId(int),SubscriptionInfo.getNumber(),NotificationManager.areBubblesAllowed(),SmsManager.getSmsManagerForSubscriptionId(),PhoneNumberUtils.compare(String, String). Each is the only call available at minSdk 29; the replacement only exists on newer releases, so the deprecated call is the compatibility path. CodeQL'sjava/deprecated-callhas no API-level awareness.$stableis generated by the Compose compiler on each class; two of them shadow each other. There is no source-level field to rename.Those need dismissals (or a
query-filtersexclusion in a CodeQL config) rather than commits — say which you prefer and I will do it.Testing
./gradlew testDebugUnitTestpassesAttachmentSaveFeedbackTest(the save shows its outcome) and aLockSessionTestcase that holds the session's API to the names that describe it, so the false positive cannot come back.saved=N/totalinAttachmentSave) still cover the write.Related issue
None — from the repository's code-scanning page.