fix: Upgrade to API 35

This commit is contained in:
J-Jamet committed 2025-09-09 11:45:30 +02:00
1 parent 30dd7c567c
commit e8ec27dc38
16 files changed
+42 -22

No files matched your search

@@ -58,7 +58,7 @@ class AboutActivity : StylishActivity() {
var version: String
var build: String
try {
version = packageManager.getPackageInfoCompat(packageName).versionName
version = packageManager.getPackageInfoCompat(packageName).versionName ?: ""
build = BuildConfig.BUILD_VERSION
} catch (e: NameNotFoundException) {
Log.w(javaClass.simpleName, "Unable to get the app or the build version", e)
@@ -1373,7 +1373,8 @@ class GroupActivity : DatabaseLockActivity(),
}
else -> {
// Load the previous group
loadMainGroup(mPreviousGroupsIds.removeLast())
loadMainGroup(mPreviousGroupsIds
.removeAt(mPreviousGroupsIds.lastIndex))
}
}
}
@@ -12,6 +12,7 @@ import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_NONE
import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE
import android.os.Build
import android.os.IBinder
import android.util.Log
import android.util.TypedValue
import android.widget.Toast
import androidx.core.app.NotificationCompat
@@ -156,11 +157,21 @@ abstract class NotificationService : Service() {
mReset = true
}
override fun onDestroy() {
override fun onTimeout(startId: Int, fgsType: Int) {
super.onTimeout(startId, fgsType)
Log.e(javaClass::class.simpleName, "The service took too long to execute")
cancelNotification()
stopSelf()
}
protected fun cancelNotification() {
mTimerJob?.cancel()
mTimerJob = null
notificationManager?.cancel(notificationId)
}
override fun onDestroy() {
cancelNotification()
super.onDestroy()
}