Eleven: ensure we got proper permissions before initializing
When opening the app we check, if we got storage permissions granted.
If not, we request them and only if we got them start to initialize.
However, the base classes ignored the permission requirement and
initialized no matter what, which results in binding to the
MusicPlaybackService, which stops itself without storage permissions.
As we always return a binder instance though, it is possible that the
binder can be called before the service had time to stop itself, resulting
in crashes like:
java.lang.NullPointerException: Attempt to invoke virtual method
'boolean org.lineageos.eleven.MusicPlaybackService$MultiPlayer.isInitialized()'
on a null object reference
To prevent this only actually start initializing, when we got the permissions
granted.
Change-Id: I3827769ecd6a0a3acc1ce742fe4477b515eaa9fe
Signed-off-by:
Alexander Martinz <amartinz@shiftphones.com>
Loading
Please register or sign in to comment