Implement Storage Access Framework

* re-work finished mission database
* re-work DownloadMission and bump it Serializable version
* keep the classic Java IO API
* SAF Tree API support on Android Lollipop or higher
* add wrapper for SAF stream opening
* implement Closeable in SharpStream to replace the dispose() method

* do required changes for this API:
** remove any file creation logic from DownloadInitializer
** make PostProcessing Serializable and reduce the number of iterations
** update all strings.xml files
** storage helpers: StoredDirectoryHelper & StoredFileHelper
** best effort to handle any kind of SAF errors/exceptions
This commit is contained in:
kapodamy 2019-04-05 14:45:39 -03:00
parent 8d8059229f
commit 7ca7952790
62 changed files with 2439 additions and 1180 deletions

View file

@ -11,7 +11,7 @@
<string name="saved_tabs_key" translatable="false">saved_tabs_key</string>
<!-- Key values -->
<string name="download_path_key" translatable="false">download_path</string>
<string name="download_path_video_key" translatable="false">download_path</string>
<string name="download_path_audio_key" translatable="false">download_path_audio</string>
<string name="use_external_video_player_key" translatable="false">use_external_video_player</string>
@ -160,6 +160,21 @@
<string name="clear_views_history_key" translatable="false">clear_play_history</string>
<string name="clear_search_history_key" translatable="false">clear_search_history</string>
<string name="downloads_storage_api" translatable="false">downloads_storage_api</string>
<!-- WARNING: changing the default value will require update the code too -->
<string name="downloads_storage_api_default" translatable="false">javaIO</string>
<string-array name="downloads_storage_api_values" translatable="false">
<item translatable="false">SAF</item>
<item translatable="false">javaIO</item>
</string-array>
<string-array name="downloads_storage_api_description" translatable="true">
<item translatable="true">@string/storage_access_framework_description</item>
<item translatable="true">@string/java_io_description</item>
</string-array>
<!-- FileName Downloads -->
<string name="settings_file_charset_key" translatable="false">file_rename</string>
<string name="settings_file_replacement_character_key" translatable="false">file_replacement_character</string>