BlackyHawky / Clock

Privacy-conscious open-source clock, based on AOSP Clock
Apache License 2.0
134 stars 10 forks source link

no bedtime reminder notification #60

Open j-lakeman opened 1 month ago

j-lakeman commented 1 month ago

Describe the bug Really appreciate the bedtime and wake up feature! Unfortunately I don't receive a bedtime notification.

To Reproduce

  1. enable bedtime reminder notification
  2. no reminder rings

Expected behavior Reminder should ring as set

App version 2.4

Device (please complete the following information):

BlackyHawky commented 1 month ago

You have to enable bedtime alarm and wakeup alarm.

j-lakeman commented 1 month ago

Thanks for your swift answer! Yep I've done that already. The wake-up setting creates an alarm whereas the bedtime one doesn't if that helps.

j-lakeman commented 1 month ago

Actually just got this:

type: crash
osVersion: google/redfin/redfin:14/UP1A.231105.001.B2/2024060500:user/release-keys
package: com.best.deskclock:2005
process: com.best.deskclock
processUptime: 198 + 342 ms
installer: com.machiav3lli.fdroid

java.lang.RuntimeException: Unable to start service com.best.deskclock.bedtime.BedtimeService@1f84ed4 with Intent { act=com.best.deskclock.action.LAUNCH_BEDTIME cmp=com.best.deskclock/.bedtime.BedtimeService }: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.best.deskclock.data.Weekdays.isBitOn(int)' on a null object reference
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5079)
    at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loopOnce(Looper.java:232)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8532)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ExecInit.main(ExecInit.java:50)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.best.deskclock.data.Weekdays.isBitOn(int)' on a null object reference
    at com.best.deskclock.bedtime.BedtimeService.getNextBedtime(BedtimeService.java:112)
    at com.best.deskclock.bedtime.BedtimeService.scheduleBedtimeMode(BedtimeService.java:292)
    at com.best.deskclock.bedtime.BedtimeService.startBedtimeMode(BedtimeService.java:268)
    at com.best.deskclock.bedtime.BedtimeService.onStartCommand(BedtimeService.java:69)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5061)
    ... 11 more
BlackyHawky commented 1 month ago

I guess it's because no day of the week is checked?

j-lakeman commented 1 month ago

Nope, Monday to Thursday and Sunday checked for bedtime and Monday to Friday for wake up

BlackyHawky commented 4 weeks ago

@j-lakeman Could you please tell me step by step what you did to make this bug appear? I can't reproduce this bug on my devices.

Nilsu11 commented 4 weeks ago

The issue here is starting the bedtime mode when the DataSaver hasn't regained it's data. so basically not touching the app when bedtime launches or it's remind notification. there weren't any other errors because I gave them defauflt values in DataSaver. @BlackyHawky To fix this issue I would start adding the linesaver.restore(); as line 62 in BedtimeService. At the moment I can't test this but that line should fix this issue.

BlackyHawky commented 4 weeks ago

Since I don't know how to reproduce this problem, I trust you. Do the tests when you can and let me know. 😉