mirror of
https://github.com/rafaelvcaetano/melonDS-android.git
synced 2024-11-23 05:39:41 +00:00
Fix cheat import not working on Android 14 devices
This commit is contained in:
parent
6d180774cd
commit
2e505830ec
@ -8,6 +8,7 @@
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||
|
||||
<application
|
||||
android:name=".MelonDSApplication"
|
||||
@ -130,5 +131,10 @@
|
||||
android:authorities="${applicationId}.androidx-startup"
|
||||
android:exported="false"
|
||||
tools:node="remove" />
|
||||
|
||||
<service
|
||||
android:name="androidx.work.impl.foreground.SystemForegroundService"
|
||||
android:foregroundServiceType="dataSync"
|
||||
tools:node="merge" />
|
||||
</application>
|
||||
</manifest>
|
||||
|
@ -1,7 +1,9 @@
|
||||
package me.magnum.melonds.common.workers
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.ServiceInfo
|
||||
import android.content.res.AssetFileDescriptor
|
||||
import android.os.Build
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.net.toUri
|
||||
@ -122,7 +124,10 @@ class CheatImportWorker @AssistedInject constructor(
|
||||
.setProgress(100, progress, indeterminate)
|
||||
.build()
|
||||
|
||||
return ForegroundInfo(NOTIFICATION_ID_CHEATS_IMPORT, notification)
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
ForegroundInfo(NOTIFICATION_ID_CHEATS_IMPORT, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
|
||||
} else {
|
||||
ForegroundInfo(NOTIFICATION_ID_CHEATS_IMPORT, notification)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package me.magnum.melonds.common.workers
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.ServiceInfo
|
||||
import android.os.Build
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.hilt.work.HiltWorker
|
||||
@ -45,6 +47,10 @@ class RetroAchievementsSubmissionWorker @AssistedInject constructor(
|
||||
.setSmallIcon(R.drawable.ic_melon_small)
|
||||
.build()
|
||||
|
||||
return ForegroundInfo(NOTIFICATION_ID_ACHIEVEMENT_SUBMISSION, notification)
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
ForegroundInfo(NOTIFICATION_ID_ACHIEVEMENT_SUBMISSION, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
|
||||
} else {
|
||||
ForegroundInfo(NOTIFICATION_ID_ACHIEVEMENT_SUBMISSION, notification)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user