Update: I've updated the question, check the bottom of this post for the details I've found so far and the last problems standing in my way

The problem

My work schedule is provided to me as an online iCal file, which I have imported into Google Calendar. This way all events are visible in my Google Calendar. I'm attempting to set up my phone to switch into do-not-disturb mode when I'm at work. This is a feature that has been added in Android 6.0.

Android 6 added a neat feature to switch to Do not Disturb mode during calendar events. I managed to get this working using my default Google calendar. However, the imported events from the external iCal URL don't seem to get picked up: only events I manually add to Google Calendar turn my phone into do-not-disturb.

Time-based rules work perfectly so the feature itself is not broken.

My current settings are as follows:

Rule name: work During events for: my.email.address@gmail.com
(into which I've imported the iCal URL)
Where reply is: Yes, Maybe or Not replied
Do not disturb: Total silence

What I've tried:

  • Add the iCal URL to a different Google account
  • Add the iCal URL to the Outlook app and select that account in the automatic DND settings
  • Modify the iCal (using a PHP script) to add the RSVP status to every event (every event now says it has been accepted)

My phone details

Device: Oneplus One
Software: CyanogenMod 13 (the latest nightly)
Root: available if necessary

I know my way around ADB and the Linux shell if I need to modify my system files. I know apps are available to do the same thing Android is supposed to do, but I prefer not installing an extra app.

Update #1

I found the Java file which handles these events. It seems like the problems lies with line 124: getPrimaryCalendars. The code seems to only accept events from primary calendar. Imported calendars are not used as primary calendars though...

Update #2

Okay, so the list of requirements for the Do not Disturb event detection to work seems to be as follows:

  1. The current time must be greater than the beginning of the event and the current time must be less than the end of the event
  2. The calendar the event is in must be
    • Visible
    • Primary
  3. The event availability field must NOT be "free" (so it should be marked as AVAILABILITY_BUSY, AVAILABILITY_TENTATIVE or something else, as long as it's not AVAILABILITY_FREE)
  4. It should meet the attendee requirements: the event has an attendee with the same email address as the "calendar owner". This means an attendee value needs to be set for in the iCal file, containing the email address of the Google account the iCal file was imported into.
  5. The "reply" field must be equal to the option the user selected. This means the attendee status must be ATTENDEE_STATUS_ACCEPTED if the user requests to only activate the rule when an event has been accepted, ATTENDEE_STATUS_ACCEPTED or ATTENDEE_STATUS_TENTATIVE for "yes or maybe" or anything but ATTENDEE_STATUS_DECLINED when the user selects "yes, maybe or not replied".

Does anybody know how to pass an imported calendar through this filter? Or how to make a calendar "primary" so the check can succeed?

  • Please any solution? I have this issue too. – Vecino Jan 31 '17 at 14:46
  • Unfortunately, no. iCal calendars can not be made primary in any official way. It should be possible using a third party app though such as Tasker. – gertmenkel Feb 1 '17 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.