Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e08cc0a authored by Alexander Martinz's avatar Alexander Martinz Committed by Michael W
Browse files

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's avatarAlexander Martinz <amartinz@shiftphones.com>
parent 36a77899
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment