Skip to content

Commit

Permalink
Merge pull request #665 from alexandrVakhtinTari/feature/android_12_a…
Browse files Browse the repository at this point in the history
…daptation

feat: android 12 security adaptation
  • Loading branch information
alexandrVakhtinTari authored Nov 10, 2021
2 parents 65cc68b + 9b395c3 commit f895a45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <!-- For GSuite API -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> <!-- remove billing support in case it gets included by a 3rd party lib -->
<uses-permission
android:name="com.android.vending.BILLING"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ internal class NotificationHelper(private val context: Context) {

fun buildForegroundServiceNotification(): Notification {
val intent = Intent(context, HomeActivity::class.java)
val pendingIntent = PendingIntent.getActivity(context, 0, intent, 0)
val pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE)
// prepare foreground service notification
return NotificationCompat.Builder(
context,
Expand Down Expand Up @@ -149,8 +149,7 @@ internal class NotificationHelper(private val context: Context) {
Intent(context, HomeActivity::class.java).apply { flags = FLAG_ACTIVITY_CLEAR_TOP },
TxDetailsActivity.createIntent(context, TxId(tx.id))
)
val pendingIntent =
PendingIntent.getActivities(context, 0, intents, PendingIntent.FLAG_UPDATE_CURRENT)
val pendingIntent = PendingIntent.getActivities(context, 0, intents, PendingIntent.FLAG_IMMUTABLE)

// prepare transaction notification
val notification: Notification = NotificationCompat.Builder(
Expand Down Expand Up @@ -192,10 +191,8 @@ internal class NotificationHelper(private val context: Context) {
Intent(context, HomeActivity::class.java).apply { flags = FLAG_ACTIVITY_CLEAR_TOP },
TxDetailsActivity.createIntent(context, TxId(tx.id))
)
val pendingIntent =
PendingIntent.getActivities(context, 0, intents, PendingIntent.FLAG_UPDATE_CURRENT)
val notification: Notification =
NotificationCompat.Builder(context, APP_NOTIFICATION_CHANNEL_ID).run {
val pendingIntent = PendingIntent.getActivities(context, 0, intents, PendingIntent.FLAG_IMMUTABLE)
val notification = NotificationCompat.Builder(context, APP_NOTIFICATION_CHANNEL_ID).run {
setSmallIcon(R.drawable.tx_notification_icon)
setDefaults(DEFAULT_ALL)
setContentIntent(pendingIntent)
Expand Down

0 comments on commit f895a45

Please sign in to comment.