Skip to content

Part 1/2 fixing sleeptimer change#381

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

Part 1/2 fixing sleeptimer change#381
IDS-YN wants to merge 1 commit intoFossifyOrg:mainfrom
IDS-YN:patch-1

Conversation

@IDS-YN
Copy link

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

First file of two to be edited to fix this bug: #345

This request affect the file MainActivity.kt

sleepTimerChanged wasn't used so I added it in the showSleepTimer under the condition that it is called if the value of sleeptimer is above 0. Also in sleepTimerChanged I put the two binding under a if condition checking if the value of the sleeptimer it above 0,, otherwise if it is 0 it is left to finish but could be uneccessary because the function shouldn't be called if the timer is already at 0.

Sorry for making the fix in two pull request I'm still new to this, next request is final and will only affect the file: SleepTimer.kt

Type of change(s)

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

What changed and why

  • Fix in MainActivity.kt to call sleepTimerChanged
  • Slight change to sleepTimerChanged's logic though could be a useless change

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.

First file of two to be edited

sleepTimerChanged wasn't used so I added it in the showSleepTimer under the condition that it is called if the value of sleeptimer is above 0. Also in sleepTimerChanged I put the two binding under a if condition checking if the value of the sleeptimer it above 0,, otherwise if it is 0 it is left to finish but could be uneccessary because the function shouldn't be called if the timer is already at 0.

Sorry for making the fix in two pull request I'm still new to this, next request if final and only affect the file: SleepTimer.kt
@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.

Please see this comment.

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