Improve the ML initialization workflow
This issue is following the comments on !1117 (merged)
What should be done:
- The java wrapper should not be the one dealing with a corrupted database. It should always return the exact ML return value. Therefore
-
ML_INIT_DB_UNRECOVERABLE
should not exist -
MedialibraryImpl.init
should only return the values sent by the ML (and shouldn't try to clear the DB here) - the kotlin caller should be in charge of clearing the DB if needed and dealing with the result (bool) here
- These medialibrary setter methods should only be called in some circumstances :
medialibrary.setLibVLCInstance((VLCInstance.getInstance(context) as LibVLC).getInstance())
medialibrary.setDiscoverNetworkEnabled(true)
If initCode != ML_INIT_FAILED and if clearDatabase succeeded