android 12 FLAG_IMMUTABLE
This commit is contained in:
parent
59e7d53e7d
commit
c66cf22c46
@ -560,7 +560,11 @@ class MainService : Service() {
|
|||||||
addCategory(Intent.CATEGORY_LAUNCHER)
|
addCategory(Intent.CATEGORY_LAUNCHER)
|
||||||
putExtra("type", type)
|
putExtra("type", type)
|
||||||
}
|
}
|
||||||
val pendingIntent = PendingIntent.getActivity(this, 0, intent, FLAG_UPDATE_CURRENT)
|
val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
PendingIntent.getActivity(this, 0, intent, FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE)
|
||||||
|
} else {
|
||||||
|
PendingIntent.getActivity(this, 0, intent, FLAG_UPDATE_CURRENT)
|
||||||
|
}
|
||||||
val notification = notificationBuilder
|
val notification = notificationBuilder
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setSmallIcon(R.mipmap.ic_launcher)
|
.setSmallIcon(R.mipmap.ic_launcher)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user