meta: remove access_network_state perm [#22]

ExoPlayer's online functionality will cause the library to request the
ACCESS_NETWORK_STATE permission. We don't need this since we use
ExoPlayer for local playback only. For simplicity [and to remove a
weird suspicious permission, we just disable it]
This commit is contained in:
OxygenCobalt
2021-07-02 08:32:38 -06:00
parent 7b5e817d3b
commit f1f2fcf41d
4 changed files with 14 additions and 6 deletions
+4
View File
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.oxycblt.auxio">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Workaround for ExoPlayer's online functionality requiring unnecessary permissions -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" tools:node="remove"/>
<queries />
<application
@@ -14,7 +14,7 @@ import org.oxycblt.auxio.playback.state.PlaybackStateManager
/**
* Nightmarish class that coordinates communication between [MediaSessionCompat], [Player],
* and [PlaybackStateManager]
* and [PlaybackStateManager].
*/
class PlaybackSessionConnector(
private val context: Context,
@@ -106,6 +106,9 @@ class PlaybackSessionConnector(
.putString(MediaMetadataCompat.METADATA_KEY_ALBUM, song.album.name)
.putLong(MediaMetadataCompat.METADATA_KEY_DURATION, song.duration)
// Load the cover asynchronously. This is the entire reason I don't use a plain
// MediaSessionConnector, which AFAIK makes it impossible to load this the way I do
// without a bunch of stupid race conditions.
loadBitmap(context, song) { bitmap ->
builder.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, bitmap)
mediaSession.setMetadata(builder.build())