Skip to content

fix: prevent app close on sleep timer reset#382

Open
IDS-YN wants to merge 1 commit intoFossifyOrg:mainfrom
IDS-YN:patch-2
Open

fix: prevent app close on sleep timer reset#382
IDS-YN wants to merge 1 commit intoFossifyOrg:mainfrom
IDS-YN:patch-2

Conversation

@IDS-YN
Copy link

@IDS-YN IDS-YN commented Feb 14, 2026

Second file edit for the fixe of this bug: #345

Changed the logic for PlaybackService.toggleSleepTimer() to be sure the sleeptimer stops when the timer hits 0 and that the timer starts/keeps going at 0 of above so when there's already a sleeptimer set it wont cause a problem. New val sleepTimerCurrent corresponds to current value in the timer, hope it stays in style with the writing code.

Once again sorry for making the pull in two requests instead of one.

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

  • Changed the logic of how stopSleepTimer and startSleepTimer is called in PlaybackService

Tests performed

  • Tested on Android Studio, changing the timer went as expected. First timer is switched to the newly selected timer and doing so no longer crash the app.

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • I understand every change in this pull request.

Second file edit for the fixe of this bug: FossifyOrg#345

Changed the logic for PlaybackService.toggleSleepTimer() to be sure the sleeptimer stops when the timer hits 0 and that the timer starts/keeps going at 0 of above so when there's already a sleeptimer set it wont cause a problem. New val sleepTimerCurrent corresponds to current value in the timer, hope it stays in style with the writing code.

Once again sorry for making the pull in two requests instead of one.
@IDS-YN IDS-YN requested a review from naveensingh as a code owner February 14, 2026 01:55
Copy link
Member

@naveensingh naveensingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once again sorry for making the pull in two requests instead of one.

You can make changes to this PR's branch directly using GitHub. Just redo the changes from your first PR https://github.com/FossifyOrg/Music-Player/pull/381/changes to the file located here: MainActivity.kt (click to edit)

Thanks.

@naveensingh naveensingh changed the title Part 2/2 fixing sleeptimer change fix: prevent app close on sleep timer reset Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App crashes when sleep timer is reset and then canceled

2 participants