Android 10 changes
This commit is contained in:
parent
09c056f5ca
commit
1a10984307
5 changed files with 6 additions and 4 deletions
|
@ -4,7 +4,7 @@ apply plugin: 'kotlin-android-extensions'
|
|||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
compileSdkVersion 29
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<application
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:name=".App"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
|
|
|
@ -686,7 +686,7 @@ public class MusicService extends Service implements
|
|||
.build());
|
||||
}
|
||||
|
||||
private void updateMediaSessionMetaData() {
|
||||
void updateMediaSessionMetaData() {
|
||||
final Song song = getCurrentSong();
|
||||
|
||||
if (song.getId() == -1) {
|
||||
|
@ -1047,7 +1047,6 @@ public class MusicService extends Service implements
|
|||
try {
|
||||
int newPosition = playback.seek(millis);
|
||||
throttledSeekHandler.notifySeek();
|
||||
updateMediaSessionPlaybackState();
|
||||
return newPosition;
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
|
|
|
@ -25,6 +25,8 @@ class ThrottledSeekHandler(
|
|||
) : Runnable {
|
||||
|
||||
fun notifySeek() {
|
||||
musicService.updateMediaSessionPlaybackState()
|
||||
musicService.updateMediaSessionMetaData()
|
||||
handler.removeCallbacks(this)
|
||||
handler.postDelayed(this, THROTTLE)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.41'
|
||||
ext.kotlin_version = '1.3.61'
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
|
|
Loading…
Reference in a new issue