diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-07-06 19:04:56 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-07-06 19:05:52 +0200 |
commit | e4a49a535635ea4e1945c27d6a549984f3df7f4e (patch) | |
tree | d1ec380f0f09c1c5b0501a2bf022f1a5c3f6c3b4 /ui/src/main | |
parent | 353679801e643d9e4518ba4ad73cb91b509ca1fc (diff) |
ui: use api 34's startActivityAndCollapse
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/QuickTileService.kt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/src/main/java/com/wireguard/android/QuickTileService.kt b/ui/src/main/java/com/wireguard/android/QuickTileService.kt index 7cd13e6e..b6009fb6 100644 --- a/ui/src/main/java/com/wireguard/android/QuickTileService.kt +++ b/ui/src/main/java/com/wireguard/android/QuickTileService.kt @@ -4,6 +4,7 @@ */ package com.wireguard.android +import android.app.PendingIntent import android.content.Intent import android.graphics.Bitmap import android.graphics.Canvas @@ -53,7 +54,12 @@ class QuickTileService : TileService() { null -> { val intent = Intent(this, MainActivity::class.java) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - startActivityAndCollapse(intent) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + startActivityAndCollapse(PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE)) + } else { + @Suppress("DEPRECATION") + startActivityAndCollapse(intent) + } } else -> { unlockAndRun { |