Skip to content

Commit a485c22

Browse files
committed
Adjust FocusMode flow and vibration behavior
- Always restore DND (remove conditional on shouldAutoStart). - Move vibration out of the sound-pref block and increase its duration to 2500ms so vibration occurs independently of sound settings
1 parent f64f7c8 commit a485c22

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Reef/src/main/java/dev/pranav/reef/accessibility/FocusModeService.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,11 @@ class FocusModeService: Service() {
270270

271271
if (!state.isPomodoroMode) {
272272
endSession()
273-
return
273+
} else {
274+
transitionPomodoroPhase()
274275
}
275276

276-
transitionPomodoroPhase()
277+
277278
}
278279

279280
private fun endSession() {
@@ -341,18 +342,17 @@ class FocusModeService: Service() {
341342
showBreakEndedNotification()
342343
}
343344
} else {
344-
if (!shouldAutoStart) {
345-
restoreDND()
346-
}
345+
restoreDND()
347346
}
348347

349348
if (prefs.getBoolean("pomodoro_sound_enabled", true)) {
350-
if (prefs.getBoolean("pomodoro_vibration_enabled", true)) {
351-
AndroidUtilities.vibrate(this, 1000)
352-
}
353349
playTransitionSound()
354350
}
355351

352+
if (prefs.getBoolean("pomodoro_vibration_enabled", true)) {
353+
AndroidUtilities.vibrate(this, 1000)
354+
}
355+
356356
val notificationText = if (shouldAutoStart) {
357357
getString(R.string.time_remaining, formatTime(nextPhase.duration))
358358
} else {

0 commit comments

Comments
 (0)