eDrive: Implement local trash bin
Summary
Implement local trash bin for eDrive.
Description
At some unexpected point, eDrive is deleting user local files. We want to set up a security belt so that this does not happen because it is critical for users and we could lose credibility a lot with this issue.
While we are finding the root cause of the deletion issue, we can implement a local trash bin for files deleted by eDrive. The files would stay one month in the trash bin (they're deleted on their 31st day of stay in the trash), then the files would be deleted completely. This way, the users noticing they have missing files can recover them for one month.
Identification and deletion of files needing permanent deletion (files that have been in the trash for 30 days or more) in the trash bin can run once a day.
TODO
-
Create the recycle bin when an account is registered -
Register a periodic worker to clean up the bin regularly (once a day) -
Update local deletion task, to move file into the bin instead of deleting it -
Create TC
Technical point:
For create the bin we'll need to access ExternalStorageDirectory Which can be unavailable for writing, etc.
https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()