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:
parent
7b5e817d3b
commit
f1f2fcf41d
4 changed files with 14 additions and 6 deletions
|
@ -1,11 +1,15 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="org.oxycblt.auxio">
|
package="org.oxycblt.auxio">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<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 />
|
<queries />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.oxycblt.auxio.playback.state.PlaybackStateManager
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Nightmarish class that coordinates communication between [MediaSessionCompat], [Player],
|
* Nightmarish class that coordinates communication between [MediaSessionCompat], [Player],
|
||||||
* and [PlaybackStateManager]
|
* and [PlaybackStateManager].
|
||||||
*/
|
*/
|
||||||
class PlaybackSessionConnector(
|
class PlaybackSessionConnector(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
|
@ -106,6 +106,9 @@ class PlaybackSessionConnector(
|
||||||
.putString(MediaMetadataCompat.METADATA_KEY_ALBUM, song.album.name)
|
.putString(MediaMetadataCompat.METADATA_KEY_ALBUM, song.album.name)
|
||||||
.putLong(MediaMetadataCompat.METADATA_KEY_DURATION, song.duration)
|
.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 ->
|
loadBitmap(context, song) { bitmap ->
|
||||||
builder.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, bitmap)
|
builder.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, bitmap)
|
||||||
mediaSession.setMetadata(builder.build())
|
mediaSession.setMetadata(builder.build())
|
||||||
|
|
|
@ -135,7 +135,7 @@ Contains all the detail UIs for some data types in Auxio. All detail user interf
|
||||||
|
|
||||||
#### `.library`
|
#### `.library`
|
||||||
|
|
||||||
The UI and adapters for the library view in Auxio, `LibraryViewModel` handles the sorting and which data to display in the fragment, while `LibraryFragment` and `LibraryAdapter` display the data.
|
The UI and adapters for the library view in Auxio, `LibraryViewModel` handles the sorting and which data to display in the fragment, while `LibraryFragment` and `LibraryAdapter` displays the data.
|
||||||
|
|
||||||
#### `.music`
|
#### `.music`
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ PlaybackStateManager───────────────────┘
|
||||||
|
|
||||||
`PlaybackStateManager` is the shared object that contains the master copy of the playback state, doing all operations on it. This object should ***NEVER*** be used in a UI, as it does not sanitize input and can cause major problems if a Volatile UI interacts with it. It's callback system is also prone to memory leaks if not cleared when done. `PlaybackViewModel` should be used instead, as it exposes stable data and safe functions that UIs can use to interact with the playback state.
|
`PlaybackStateManager` is the shared object that contains the master copy of the playback state, doing all operations on it. This object should ***NEVER*** be used in a UI, as it does not sanitize input and can cause major problems if a Volatile UI interacts with it. It's callback system is also prone to memory leaks if not cleared when done. `PlaybackViewModel` should be used instead, as it exposes stable data and safe functions that UIs can use to interact with the playback state.
|
||||||
|
|
||||||
`PlaybackService`'s job is to use the playback state to manage the ExoPlayer instance and notification and also modify the state depending on system events, such as when a button is pressed on a headset. It should **never** be bound to, mostly because there is no need given that `PlaybackViewModel` exposes the same data in a much safer fashion.
|
`PlaybackService`'s job is to use the playback state to manage the ExoPlayer instance and notification and also modify the state depending on system events, such as when a button is pressed on a headset. It should **never** be bound to, mostly because there is no need given that `PlaybackViewModel` exposes the same data in a much safer fashion. `PlaybackService` also controls the `PlaybackSessionConnector` and `AudioReactor` classes, which manage the `MediaSession` and `AudioFocus` state respectively.
|
||||||
|
|
||||||
#### `.recycler`
|
#### `.recycler`
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,12 @@ Auxio is local music player for android that I built for myself, primarily. Its
|
||||||
|
|
||||||
## Where can I download Auxio?
|
## Where can I download Auxio?
|
||||||
|
|
||||||
Currently, its available on the [IzzyOnDroid F-Droid repository](https://apt.izzysoft.de/fdroid/). I still want to make some changes and get feedback before I submit it to the mainline F-Droid repository, but it will arrive there eventually.
|
Auxio is available on the [F-Droid](https://f-droid.org/en/packages/org.oxycblt.auxio/) repository.
|
||||||
|
|
||||||
## Can I translate Auxio to my native language?
|
## Can I translate Auxio to my native language?
|
||||||
|
|
||||||
See the [Translations](https://github.com/OxygenCobalt/Auxio/issues/3) issue for guidance on how to create translations and submit them to the project. Any contributions are appreciated.
|
See the [Translations](https://github.com/OxygenCobalt/Auxio/issues/3) issue for guidance on how to create translations and submit them to the project. Any contributions are appreciated and
|
||||||
|
tend to always be accepted.
|
||||||
|
|
||||||
## How can I contribute/report issues?
|
## How can I contribute/report issues?
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ Open an [Issue](https://github.com/OxygenCobalt/Auxio/issues) or a [Pull Request
|
||||||
|
|
||||||
## Why ExoPlayer?
|
## Why ExoPlayer?
|
||||||
|
|
||||||
ExoPlayer is far more flexible than the native MediaPlayer API, which allows Auxio to have consistent behavior across devices & OEMs, along with allowing Auxio to be extended to music sources outside of local files. You can read more about the benefits (and drawbacks) of ExoPlayer [Here](https://exoplayer.dev/pros-and-cons.html).
|
ExoPlayer is far more flexible than the native MediaPlayer API, which allows consistent behavior across devices & OEMs amd the ability to be extended to music sources outside of local files. You can read more about the benefits (and drawbacks) of ExoPlayer [Here](https://exoplayer.dev/pros-and-cons.html).
|
||||||
|
|
||||||
## Why cant I have a custom accent?
|
## Why cant I have a custom accent?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue