Closed rkoshak closed 1 year ago
I couldn't find any information that the sender of the alarm is hidden on Android 13, but that seems to be the case.
In case it helps, that log from above was created by asking Google Assistant to set an alarm, not but using the clock app or Sleep as Android app. I can generate logs for those if you think it will help.
I was able to reproduce this issue with an Android 13 emulator. I read through all migration guides for Android 13, but couldn't find a clue for this.
null
as valid sender. But that means you might get invalid alarms, e.g. set by Tasker.Problem still occures on Android 12 after installing the beta application 2.22.3.
The app only sends a value once, on setup of the alarm clock item and never sends an update.
Can you enable debug logging? Do any notifications appear then?
I have enabled the logging for troubleshooting and waited a little bit. Then I received this notification:
"Ignored alarm time update to 09:45 2022-09-23 which was sent by com.android.providers.calendar"
I got this message several times. I can't find anything in the log it self about the alarm. I only see updates for call state and charging.
As you can see in the message this alarm was sent by the calendar app, so it's not a real alarm clock. Can you try the Google alarm app?
I noticed that too! I did have a lot of meetings today...
I've tried with the Google clock app. And the Samsung clock app. Both don't show up in the logging. Only the ignored calendar app when I search for alarm in the logging
Is there anything else I can test to help find the problem?
Are there any other debug notifications?
No, no other messages... Also still nothing in the logging.
FYI, there is a bug report for the Android Framework regarding the missing pendingIntent.creatorPackage
from AlarmClockInfo
on Android 13 https://issuetracker.google.com/issues/275678087
Thanks for the feedback! This explains why the alarm is not working on the Google clock app, as well as the build in Samsung clock app.
Hi @Johboh Any update on this one yet?
You can check the issue at https://issuetracker.google.com/issues/275678087 I don't know more than that.
The alarms send by the ignored Signal messenger does include an app on Android 13. Alarms by the alarm clock don't. Maybe this isn't an issue in the OS, but in several apps?
I rather think this is some security policy enforcement. creatorPackage
can be filtered from being filled out here, which - with some intermediate layers inbetween - ends up here. I have made no attempts to fully understand the latter method yet, but it's IMHO it's clear the problem is related to package visibility filtering. I guess a first step would be validating that assumption by using the QUERY_ALL_PACKAGES
permission; if that's the problem we need to think about how to deal with that.
Edit: One way to deal with that would be removing the 'send alarm clock' feature, which - given all the issues we have with the unreliable API - would not be an unreasonable option, IMO.
Another edit: Since the date of the commit introducing the filtering falls between the Android 12 and 13 releases, I'm pretty sure it's the root cause of our issue.
That sounds like a very reasonable issue. Maybe more then google making a mistake in their API.
Is there something I can test on my Android 13 device, to verify your ideas?
@maniac103 Thanks for looking into this. Indeed I can see the sender by adding the permission QUERY_ALL_PACKAGES
.
Google Play will reject the app when we add this permission, but we could add the ignored apps to the manifest: https://github.com/openhab/openhab-android/blob/main/mobile/src/main/java/org/openhab/habdroid/background/BackgroundTasksManager.kt#L308C27-L315
One way to deal with that would be removing the 'send alarm clock' feature, which - given all the issues we have with the unreliable API - would not be an unreasonable option, IMO.
I causes issue for some people, but it's also working flawless for others. The only issue I had was one wrong alarm (send by Signal) in years of using this feature.
The only issue I still see is that people with wrong alarms don't see the package name of the app that causes these alarms. Maybe add QUERY_ALL_PACKAGES
to the F-Droid version and ask people to download the beta version from there if they have an issue?
It works great now 😁 Many thanks!
This change appears to break alarms on Samsung phones. Alarms set via default clock app or "Sleep as Android" are neither detected/sent on a S23, nor on a S21 FE (both on Android 13) since the recent update in the playstore stating to "Improve sending alarm clock on Android 12 and higher"
Debug Log states:
06-13 22:28:55.807 9719 9869 I BackgroundTasksManager: Don't send update for item AlarmClock with value ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Alarmzeit-Update auf 00:00 2023-06-14 wurde ignoriert, da es von com.android.providers.calendar gesendet wurde)
...though the timestamp doesn't match with me activating/deactivating the alarm. No other related log lines.
Update: After trying to find a workaround using Tasker and tinkering around with the alarm clock events in there, all of a sudden the intents are correctly recognized again by the openhab app. :raised_eyebrow:
If this is going to be covered in #2994 I'll close this one.
Actual behaviour
I upgraded to Android 13 and ever since sending the alarm clock time to the server no longer works.
Expected behaviour
When the alarm clock is set on the phone, it sends the date time to the configured Item.
Steps to reproduce
I've set the alarm directly and using Sleep as Android and there is no indication on the server that the time was attempted to be sent.
In the app's logs I do see that it recognizes the alarm clock changed but that it wasn't sent for some reason.
Click to expand
``` ----------------------- Device information Model: Pixel 6 Pro Manufacturer: Google Brand: google Device: raven Product: raven OS: 13 Display: 1440x2898, 3.825 density Data usage policy: DataUsagePolicy(canDoLargeTransfers=true, loadIconsWithState=true, autoPlayVideos=true, canDoRefreshes=true), data saver: 1, battery saver: false ----------------------- --------- beginning of events 08-24 09:15:04.243 8375 8375 I view_enqueue_input_event: [Motion - Cancel,org.openhab.habdroid.beta/org.openhab.habdroid.ui.LogActivity] 08-24 09:15:04.945 8375 8375 I wm_on_top_resumed_lost_called: [66558864,org.openhab.habdroid.ui.LogActivity,topStateChangedWhenResumed] 08-24 09:15:04.953 8375 8375 I wm_on_paused_called: [66558864,org.openhab.habdroid.ui.LogActivity,performPause] 08-24 09:15:04.971 8375 8375 I wm_on_stop_called: [66558864,org.openhab.habdroid.ui.LogActivity,STOP_ACTIVITY_ITEM] --------- beginning of main 08-24 09:15:11.470 8375 8375 D BackgroundTasksManager: onReceive() with intent android.app.action.NEXT_ALARM_CLOCK_CHANGED 08-24 09:15:11.470 8375 8375 D BackgroundTasksManager: Alarm clock changed 08-24 09:15:11.470 8375 8375 D BackgroundTasksManager: Alarm sent by null 08-24 09:15:11.470 8375 8375 D BackgroundTasksManager: Got value 'ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 09:17 2022-08-24 which was sent by null)' for alarmClock 08-24 09:15:11.470 8375 8375 I BackgroundTasksManager: Don't send update for item AlarmClock with value ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 09:17 2022-08-24 which was sent by null) 08-24 09:15:32.058 8375 8375 I wm_on_restart_called: [66558864,org.openhab.habdroid.ui.LogActivity,performRestartActivity] 08-24 09:15:32.059 8375 8375 I wm_on_start_called: [66558864,org.openhab.habdroid.ui.LogActivity,handleStartActivity] 08-24 09:15:32.062 8375 8375 I wm_on_resume_called: [66558864,org.openhab.habdroid.ui.LogActivity,RESUME_ACTIVITY] 08-24 09:15:32.063 8375 8375 I wm_on_top_resumed_gained_called: [66558864,org.openhab.habdroid.ui.LogActivity,topWhenResuming] ```Can you reproduce the issue in demo mode?
Yes, though I don't know if it tries to send the alarm clock to my server when in demo mode so it's not clear if it's useful. On my server's side things look the same. The logs when I sent it with demo mode active are as follows.
Click to expand
``` ----------------------- Device information Model: Pixel 6 Pro Manufacturer: Google Brand: google Device: raven Product: raven OS: 13 Display: 1440x2898, 3.825 density Data usage policy: DataUsagePolicy(canDoLargeTransfers=true, loadIconsWithState=true, autoPlayVideos=true, canDoRefreshes=true), data saver: 1, battery saver: false ----------------------- --------- beginning of events 08-24 09:21:22.433 8375 8375 I view_enqueue_input_event: [Motion - Cancel,org.openhab.habdroid.beta/org.openhab.habdroid.ui.LogActivity] 08-24 09:21:23.084 8375 8375 I wm_on_top_resumed_lost_called: [25284991,org.openhab.habdroid.ui.LogActivity,topStateChangedWhenResumed] 08-24 09:21:23.104 8375 8375 I wm_on_paused_called: [25284991,org.openhab.habdroid.ui.LogActivity,performPause] 08-24 09:21:23.121 8375 8375 I wm_on_stop_called: [25284991,org.openhab.habdroid.ui.LogActivity,STOP_ACTIVITY_ITEM] --------- beginning of main 08-24 09:21:28.137 8375 8375 D BackgroundTasksManager: onReceive() with intent android.app.action.NEXT_ALARM_CLOCK_CHANGED 08-24 09:21:28.137 8375 8375 D BackgroundTasksManager: Alarm clock changed 08-24 09:21:31.810 8375 8375 D BackgroundTasksManager: onReceive() with intent android.app.action.NEXT_ALARM_CLOCK_CHANGED 08-24 09:21:31.810 8375 8375 D BackgroundTasksManager: Alarm clock changed 08-24 09:21:32.428 8375 8375 D BackgroundTasksManager: onReceive() with intent android.app.action.NEXT_ALARM_CLOCK_CHANGED 08-24 09:21:32.428 8375 8375 D BackgroundTasksManager: Alarm clock changed 08-24 09:21:34.883 8375 8375 I wm_on_restart_called: [25284991,org.openhab.habdroid.ui.LogActivity,performRestartActivity] 08-24 09:21:34.883 8375 8375 I wm_on_start_called: [25284991,org.openhab.habdroid.ui.LogActivity,handleStartActivity] 08-24 09:21:34.885 8375 8375 I wm_on_resume_called: [25284991,org.openhab.habdroid.ui.LogActivity,RESUME_ACTIVITY] 08-24 09:21:34.885 8375 8375 I wm_on_top_resumed_gained_called: [25284991,org.openhab.habdroid.ui.LogActivity,topWhenResuming] ```Environment data
Client
Server
openHAB Cloud
Logs
App log
See above
openHAB Server log
None