[Android] Refactor AssetCopyService and the way we extract resources from the assets

This solves the following issues:
1. If user uninstall Dolphin and install it again the resources will
not be copied unless the user manually clear the app cache because we
are enabling the allowBackup flag in the manifest which will make the app
restore the settings saved in the shared prefernces including the flag
assetsCopied. This PR always copy the files everytime you open Dolphin.

2. If the AssetCopyService took long time and you tried to open the settings
screen or start a game the behaviour was not expected or the emulator will
crash, this PR make sure that whatever we add to the DirectoryInitializationService
or how long it will take will still work as expected by blocking both
the settings screen and the emulaion screen to wait untill all resources
needed are copied.

3. Better communication between the DirectoryInitializationService and the
UI screens using brocast messages.
This commit is contained in:
mahdihijazi
2017-12-17 01:09:55 +01:00
parent 9f9b4bc028
commit 1190afef51
13 changed files with 374 additions and 138 deletions

View File

@ -65,7 +65,7 @@
android:theme="@style/DolphinEmulationGamecube"/>
<service android:name=".services.AssetCopyService"/>
<service android:name=".services.DirectoryInitializationService"/>
<provider
android:name=".model.GameProvider"