Skip to content

Commit

Permalink
Suppress lint StartActivityAndCollapseDeprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMarquis committed Nov 30, 2023
1 parent 0f29b52 commit 7d212c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/fr/smarquis/sleeptimer/SleepTileService.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.smarquis.sleeptimer

import android.annotation.SuppressLint
import android.app.PendingIntent.FLAG_IMMUTABLE
import android.app.PendingIntent.getActivity
import android.content.ComponentName
Expand Down Expand Up @@ -58,6 +59,7 @@ class SleepTileService : TileService() {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra(Settings.EXTRA_APP_PACKAGE, packageName)
}.let {
@SuppressLint("StartActivityAndCollapseDeprecated")
if (SDK_INT <= TIRAMISU) @Suppress("DEPRECATION") startActivityAndCollapse(it)
else startActivityAndCollapse(getActivity(this, 0, it, FLAG_IMMUTABLE))
}
Expand Down

0 comments on commit 7d212c8

Please sign in to comment.