Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using CalDAV - No widget sync. after calendar sync. #182

Closed
anthraxn8b opened this issue Aug 19, 2015 · 10 comments
Closed

Using CalDAV - No widget sync. after calendar sync. #182

anthraxn8b opened this issue Aug 19, 2015 · 10 comments

Comments

@anthraxn8b
Copy link

When CalDAV syncs my calendar the widget is not updated.

@yvolk
Copy link
Collaborator

yvolk commented Aug 28, 2015

This is CalDAV deficiency: it doesn't broadcast proper notification on update.
Anyway, we have "Refresh" button now in a widget header, which allows you to refresh the Calendar-widget on demand.

@yvolk yvolk closed this as completed Aug 28, 2015
@anthraxn8b
Copy link
Author

THX!

@dmfs
Copy link

dmfs commented Oct 12, 2015

Hi @yvolk , this is Marten, the developer of CalDAV-Sync. What broadcast do you mean? AFAIK, there is nothing that a sync adapter needs to send after syncing. If you're talking about ACTION_PROVIDER_CHANGED, that should be sent by the provider itself.
What exactly is your widget listening for?

Also, we didn't receive any other reports about this. Widget updates work well with other calendar widgets.

@yvolk
Copy link
Collaborator

yvolk commented Oct 15, 2015

@dmfs Hi Marten, yes we use this filter for notifications on Calendar data changes:

           <intent-filter>
                <action android:name="android.intent.action.PROVIDER_CHANGED" />
                <data android:scheme="content" />
                <data android:host="com.android.calendar" />
            </intent-filter>

As suggested e.g. here: http://stackoverflow.com/questions/15217723/broadcastreceiver-for-android-calendar-events

As I understand the User's problem, after your app have synced events in some calendar provider, that provider doesn't broadcast this intent.
I would suggest for your application to broadcast this intent and not rely on a concrete calendar provider implementation.

@dmfs
Copy link

dmfs commented Oct 15, 2015

Here is where the calendar provider sends the broadcast: CalendarProvider2.java line 4578

This method is called (indirectly) when events are inserted, updated or deleted.

I'm hesitating to make CalDAV-Sync send this broadcast, because that means on most devices the broadcast is sent twice (which will trigger all listening apps twice and waste precious resources). Also, it feels wrong to send such a broadcast from code that's not a content provider.

Lastly, I doubt, that any calendar app or any other sync app sends this broadcast, since that's the job of the content provider.

@anthraxn8b What kind of device do you use?

@yvolk
Copy link
Collaborator

yvolk commented Oct 16, 2015

@dmfs Please read this ticket and relax regarding duplicated broadcast: this intent is already sent (at least by some calendar applications...) even on an item selection...
https://code.google.com/p/android/issues/detail?id=55675

The notification was not well thought by Android developers, and this mistake still causes confusions by developers of related components.

BTW, official Android documentation doesn't even mention this intent: http://developer.android.com/guide/topics/providers/calendar-provider.html

@yvolk yvolk reopened this Oct 16, 2015
@anthraxn8b
Copy link
Author

Device: Nexus 4
Android version: 4.4.4
Calendar app: aCalendar+
I do not use a google calendar! ;-)

@dmfs
Copy link

dmfs commented Oct 16, 2015

Presuming that @anthraxn8b is running the stock ROM, I'd say that the CalendarProvider most certainly sends the ACTION_PROVIDER_CHANGED broadcast.

@anthraxn8b do you know how to use adb? Usually the broadcast is logged to the system log like so (just captured the log on my Nexus 5):

10-16 11:05:13.741 27272 27272 I CalendarProvider2: Sending notification intent: Intent { act=android.intent.action.PROVIDER_CHANGED dat=content://com.android.calendar }

by running adb -d logcat you can check if the broadcast appears in the log after CalDAV-Sync synced new or updated events.
If your device is rooted you could also use an app like "CatLog".

@anthraxn8b
Copy link
Author

@dmfs Sorry, but I am no longer using the Nexus 5. This does not mean that I have no Problems related to calendar syncing any longer :-)

@yvolk
Copy link
Collaborator

yvolk commented Oct 10, 2019

In 2019 we solved the problem with syncing changes by addition to the Tasks app notification intent, sent directly to the ToDo Agenda app. Otherwise notifications are blocked by Android system.
See #308 and related dmfs/opentasks#822

@yvolk yvolk closed this as completed Oct 10, 2019
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

No branches or pull requests

3 participants