Android 10 changes

This commit is contained in:
h4h13 2019-12-30 09:44:04 +05:30
parent 09c056f5ca
commit 1a10984307
5 changed files with 6 additions and 4 deletions

View file

@ -4,7 +4,7 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
android { android {
compileSdkVersion 28 compileSdkVersion 29
defaultConfig { defaultConfig {
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28

View file

@ -17,6 +17,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application <application
android:requestLegacyExternalStorage="true"
android:name=".App" android:name=".App"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"

View file

@ -686,7 +686,7 @@ public class MusicService extends Service implements
.build()); .build());
} }
private void updateMediaSessionMetaData() { void updateMediaSessionMetaData() {
final Song song = getCurrentSong(); final Song song = getCurrentSong();
if (song.getId() == -1) { if (song.getId() == -1) {
@ -1047,7 +1047,6 @@ public class MusicService extends Service implements
try { try {
int newPosition = playback.seek(millis); int newPosition = playback.seek(millis);
throttledSeekHandler.notifySeek(); throttledSeekHandler.notifySeek();
updateMediaSessionPlaybackState();
return newPosition; return newPosition;
} catch (Exception e) { } catch (Exception e) {
return -1; return -1;

View file

@ -25,6 +25,8 @@ class ThrottledSeekHandler(
) : Runnable { ) : Runnable {
fun notifySeek() { fun notifySeek() {
musicService.updateMediaSessionPlaybackState()
musicService.updateMediaSessionMetaData()
handler.removeCallbacks(this) handler.removeCallbacks(this)
handler.postDelayed(this, THROTTLE) handler.postDelayed(this, THROTTLE)
} }

View file

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.3.41' ext.kotlin_version = '1.3.61'
repositories { repositories {
jcenter() jcenter()
google() google()