Skip to content

Commit

Permalink
refactor: modify pending intent flag for android s+
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyma committed Jan 26, 2022
1 parent 5bd422a commit 194fb92
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,16 @@ class BubbleBuilder(
}

private fun getPendingIntent(): PendingIntent {
val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
} else {
PendingIntent.FLAG_UPDATE_CURRENT
}
return PendingIntent.getActivity(
context,
0,
Intent(context, BubbleActivity::class.java)
.setAction(Intent.ACTION_VIEW),
PendingIntent.FLAG_UPDATE_CURRENT
Intent(context, BubbleActivity::class.java).setAction(Intent.ACTION_VIEW),
flags
)
}

Expand Down

0 comments on commit 194fb92

Please sign in to comment.