Tiefkuehlpizze / oandbackupx

backup manager for android
GNU Affero General Public License v3.0
5 stars 0 forks source link

cache directories and invalidate it before getApplicationList #12

Closed hg42 closed 4 years ago

hg42 commented 4 years ago

the changes are small and easy, but because I wrapped code into an if, it looks like a big change.

The cache is invalidated at the beginning of getApplicationList(). Any change of the backup folder is usually followed by refreah which invokes getApplicationList.

If StorageFile should ever be used for more general purposes, getApplicationList would not be sufficient. The more correct way would then be to handle all storage operations by the same class (or a collaborating system of classes) to have full control over all changes on the underlying file system initiated by the app. Even more correct (changes from outside) would be to use file watchers.