fix(actions): stop 'ring my phone' ringing until force-close#126
Merged
Conversation
The ring-phone action played the default TYPE_RINGTONE but kept no reference to it and never stopped it, so it looped until the app was force-closed (OpenStrap#115); repeated taps stacked more unstoppable ringtones. Retain the Ringtone, auto-stop after 30s, let a second double-tap stop it early, and stop any in-progress ring before starting a new one.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesRingtone control
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@android/app/src/main/kotlin/wtf/openstrap/openstrap_edge/NativeChannels.kt`:
- Around line 377-383: In the ring-start flow around rt.play(), register the
fail-safe ringStopRunnable and post its delayed callback before calling
vibrate(ctx). Keep the existing callback removal and RING_TIMEOUT_MS scheduling,
then invoke vibration afterward so a vibration exception cannot prevent timeout
registration.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: cb6cddb6-ac59-4666-b77b-fa51bc138782
📒 Files selected for processing (1)
android/app/src/main/kotlin/wtf/openstrap/openstrap_edge/NativeChannels.kt
vibrate() can throw and perform() swallows it; scheduling the fail-safe stop first ensures a vibration failure can't leave the ringtone running with no scheduled stop. Addresses CodeRabbit review on OpenStrap#126.
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.
Fixes #115.
Problem
The double-tap ring my phone action played the default system ringtone but never held a reference to it and never stopped it.
TYPE_RINGTONEloops by design, so it rang until the app was force-closed. Repeated taps stacked more unstoppable ringtones on top.Fix (native,
NativeChannels.kt)RingtoneinactiveRingtoneso it can actually be stopped.Handler.postDelayed) — it can never ring forever again.Find-my-phone norm: rings ~30 s, or until you double-tap again.
Testing
Verified by inspection — native Kotlin, and there's no CI/SDK here to run a build. Needs on-device confirmation: double-tap rings the phone, auto-stops at 30 s, and a second double-tap stops it early.
Summary by CodeRabbit