add IMMUTABLE flag to intents

This commit is contained in:
tibbi 2022-04-13 14:20:28 +02:00
parent 0435a70377
commit c41acde516
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class MyWidgetRecordDisplayProvider : AppWidgetProvider() {
private fun setupAppOpenIntent(context: Context, views: RemoteViews) {
Intent(context, BackgroundRecordActivity::class.java).apply {
action = BackgroundRecordActivity.RECORD_INTENT_ACTION
val pendingIntent = PendingIntent.getActivity(context, OPEN_APP_INTENT_ID, this, PendingIntent.FLAG_UPDATE_CURRENT)
val pendingIntent = PendingIntent.getActivity(context, OPEN_APP_INTENT_ID, this, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
views.setOnClickPendingIntent(R.id.record_display_btn, pendingIntent)
}
}

View File

@ -283,7 +283,7 @@ class RecorderService : Service() {
private fun getOpenAppIntent(): PendingIntent {
val intent = getLaunchIntent() ?: Intent(this, SplashActivity::class.java)
return PendingIntent.getActivity(this, RECORDER_RUNNING_NOTIF_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT)
return PendingIntent.getActivity(this, RECORDER_RUNNING_NOTIF_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
private fun broadcastDuration() {