From November 2021, the Play Store will no longer be accepting
apps which use the deprecated getExternalStorageDirectory() API.
Therefore, this commit replaces uses of deprecated API with the new
scoped API (`getExternalFilesDir()` and `getExternalCacheDir()`).
It also provides a temporary migration to move user data from the
shared external directory to new storage.
Fixes#2097, #11417 and #11118