Enabled WRITE_EXTERNAL_STORAGE for A10 to avoid crashes

This commit is contained in:
Prathamesh More 2022-06-11 19:02:00 +05:30
parent 3aea91eb1e
commit 192b5c2ac7
4 changed files with 7 additions and 9 deletions

View file

@ -51,7 +51,7 @@ android {
}
}
lint {
disable 'MissingTranslation', 'ImpliedQuantity'
warning 'MissingTranslation', 'ImpliedQuantity', 'Instantiatable'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

View file

@ -13,7 +13,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
android:maxSdkVersion="29" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />

View file

@ -191,7 +191,7 @@ abstract class AbsMusicServiceActivity : AbsBaseActivity(), IMusicServiceEventLi
override fun getPermissionsToRequest(): Array<String> {
return mutableListOf(Manifest.permission.READ_EXTERNAL_STORAGE).apply {
if (!VersionUtils.hasQ()) {
if (!VersionUtils.hasR()) {
add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
}
}.toTypedArray()

View file

@ -754,11 +754,11 @@ class MusicService : MediaBrowserServiceCompat(),
this.position = position
openCurrent { success ->
completion(success)
notifyChange(META_CHANGED)
notHandledMetaChangedForCurrentTrack = false
if (success) {
prepareNextImpl()
}
notifyChange(META_CHANGED)
notHandledMetaChangedForCurrentTrack = false
}
}
@ -1088,11 +1088,9 @@ class MusicService : MediaBrowserServiceCompat(),
// We must call updateMediaSessionPlaybackState after the load of album art is completed
// if we are loading it or it won't be updated in the notification
updateMediaSessionMetaData(::updateMediaSessionPlaybackState)
savePosition()
savePositionInTrack()
serviceScope.launch(IO) {
withContext(Main) {
savePosition()
savePositionInTrack()
}
val currentSong = currentSong
HistoryStore.getInstance(this@MusicService).addSongId(currentSong.id)
if (songPlayCountHelper.shouldBumpPlayCount()) {