simple-last-fm-scrobbler / sls

Simple Scrobbler, for Android -- last.fm, libre.fm & ListenBrainz
https://simple-last-fm-scrobbler.github.io
Apache License 2.0
550 stars 99 forks source link

SDK Transition #476

Closed a-r-db closed 5 years ago

a-r-db commented 5 years ago

Updating to sls 1.5.6 broke scrobbling on my Pixel running Android 8.1 stable.

In logcat I found the following message:

BroadcastQueue: Background execution not allowed: receiving Intent { act=com.spotify.music.playbackstatechanged flg=0x10 (has extras) } to com.adam.aslfms/.receiver.SpotifyReceiver

This is due to changes in Androids background execution limits, which affects all apps targeting sdk 26 and higher.

Apps cannot use their manifests to register for most implicit broadcasts (that is, broadcasts that are not targeted specifically at the app).

Here are some details and information how to deal with the changes: Android O and the Implicit Broadcast Ban

So atm the only way I see is to stuck with targetSDK 25.

The problem: Starting with November 2018 it won't be possible to release updates targeting SKD <26. So if we want to be able to release updates on Google Play Store we properly need to rewrite the receiver logic (if there will be any way to fetch the media intents on Android 8+ at all).

Beside switching to SDK 25 I took the liberty to update the changelog and give myself credits.😅 I hope you're okay with that.

Fixes #414

I'm going to do as many updates as possible and do a release for F-Droid users. I might need to leave a legacy build going. I certainly will need to look into notification reading like all the other apps are using now.

a-r-db commented 5 years ago
  1. Legacy Implicit Broadcast reading is essentially dead.
  2. API 18 JELLY_BEAN_MR2, allows for notification reading, although will likely require a great deal of effort to implement.
  3. API 19 KitKat allows for RemoteController an older version of MediaSessionManager which is implemented in apps like QuickLyrics for example.
  4. API 21 LOLLIPOP, allows for direct information reading from the MediaSessionManager.

Chronological

a-r-db commented 5 years ago

I am settling on using the QuickLyrics style method due to the preferable code base.

Change of plans, PanoScrobbler must have noticed this and implemented the best case scenario. RemoteController requires api 21 anyways for access to Music Notifications.

a-r-db commented 5 years ago

478