2

When an Android app deletes a calendar event in a local (offline / non-synced) calendar, does Android's Calendar Storage (com.android.providers.calendar) actually delete the event or does it just flag the event as deleted?

The reason I ask is because I was shocked to discover that one of the most popular Android calendar apps, Business Calendar 2, includes deleted events in export files. If you look at the export files, the deleted events are there in plain sight. Furthermore, if you import the files back into Business Calendar 2, the deleted events now appear as regular events.

This means that if you had an event entitled "Deliver confidential documents regarding project X-Ray to client Albatross" in your non-synced calendar, and you then delete the event, it is trivial for anyone with access to your device to restore that event in seconds. No forensics tools are needed.

It also happens to make the Business Calendar 2 export files practically useless, except as way to discover events the user had deleted.

Is this a flaw in Android (KitKat), a critical bug in Business Calendar 2, or a combination of the two?

1
  • Keep in mind that even though the calendar app properly "deletes" the events they'll still be in the database file and probably on the flash memory as well. If you want true deletion then you may want to shred the calendar's database file and even then the disk's wear leveling algorithms may get in the way and relocate the "shredding" to different blocks than the blocks you actually wanted to overwrite. May 27, 2016 at 1:28

2 Answers 2

3

Maybe not an answer to the question, but useful info for those who find this question while having this problem:

For people who use offline/local calendars, and notice their .ics export contains deleted events (even recurring events, and events from years ago):

It seems that indeed, deleted events are only "marked for deletion", meaning they still appear in exports. (This problem seems to be fixed in newer Android versions, and may have only been a problem for users of offline/local calendars.)

You can observe this problem by using the Calendar Import-Export app on Android systems which are affected by this problem. Look at the event counter, it stays the same when deleting an event via your calendar app. On newer Android versions, the counter does decrease.

Edit:

I've updated the answer. It seems the problem occurs regardless of which calendar app you're using (like Etar or S Planner). I'm guessing the problem is caused by the com.android.providers.calendar system app instead (which stores the calendar events).

The problem seems to be fixed on newer Android versions.

The problem was reproducible both with Etar and S Planner on Android 6.0.1. The problem was NOT reproducible with Etar on Android 9.0, but that's probably because of the newer com.android.providers.calendar system app, and has nothing to do with what calendar app you're using.

Related quote from the developer docs for CalendarContract.Events at android.com:

There are two versions of delete: as an app and as a sync adapter. An app delete will set the deleted column on an event and remove all instances of that event. A sync adapter delete will remove the event from the database and all associated data.

Related resources:

3
  • Cheers. I've updated the answer. It seems the problem happens regardless of the calendar app used. Whether the problem happens probably depends on the version of the com.android.providers.calendar system app. May 11, 2020 at 14:40
  • Interesting. Thanks for the update. I was concerned about that. Now the challenge will be determining which versions of Android have this problem, and which versions do not. BTW, did you happen to try S Planner on Android 9.0? May 11, 2020 at 14:44
  • You're welcome. I haven't tried S Planner on Android 9.0. May 11, 2020 at 14:50
0

In case it would be helpful to others, I posted my Android calendar "marked for deletion" story in this post:

https://softwarerecs.stackexchange.com/questions/28142/offline-calendar-for-android-with-at-least-basic-functionality/82380#82380

2
  • Just like the other answer, this doesn't directly answer the question. The answer on softwarerecs is of high quality in my opinion though. Mar 3, 2022 at 17:56
  • Sir Muffington - your right, I didn't directly answer the question. I would say "neither" is the answer. The nature of this Android calendar beast results in the "flag the event as deleted". I believe most calendar users, including Business Calendar 2 users, never encounter deleted events hanging around = because they use their phones with a Google account, and their calendars sync up to Google = syncing then ultimately deletes the deleted events. The "problem" is what it is because of sync functionality = there is need to potentially "tell all other devices" to delete an event. Mar 5, 2022 at 8:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .