Merge branch 'android-sdk31' into dev

This commit is contained in:
Ming Ming 2022-12-04 00:57:56 +08:00
commit eea7933aa3
2 changed files with 9 additions and 5 deletions

View file

@ -39,7 +39,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.nkming.nc_photos"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
ndk {

View file

@ -128,7 +128,8 @@ class NotificationChannelHandler(context: Context) :
addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
}
val openPendingIntent = PendingIntent.getActivity(
_context, 0, openIntent, PendingIntent.FLAG_UPDATE_CURRENT
_context, 0, openIntent,
PendingIntent.FLAG_UPDATE_CURRENT or getPendingIntentFlagImmutable()
)
builder.setContentIntent(openPendingIntent)
@ -175,7 +176,8 @@ class NotificationChannelHandler(context: Context) :
)
)
val sharePendingIntent = PendingIntent.getActivity(
_context, 1, shareChooser, PendingIntent.FLAG_UPDATE_CURRENT
_context, 1, shareChooser,
PendingIntent.FLAG_UPDATE_CURRENT or getPendingIntentFlagImmutable()
)
builder.addAction(
0, _context.getString(
@ -228,7 +230,8 @@ class NotificationChannelHandler(context: Context) :
putExtra(K.EXTRA_NOTIFICATION_ID, id)
}
val cancelPendingIntent = PendingIntent.getBroadcast(
_context, 0, cancelIntent, PendingIntent.FLAG_UPDATE_CURRENT
_context, 0, cancelIntent,
PendingIntent.FLAG_UPDATE_CURRENT or getPendingIntentFlagImmutable()
)
builder.addAction(
0, _context.getString(android.R.string.cancel), cancelPendingIntent
@ -273,7 +276,8 @@ class NotificationChannelHandler(context: Context) :
addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
}
val openPendingIntent = PendingIntent.getActivity(
_context, 0, openIntent, PendingIntent.FLAG_UPDATE_CURRENT
_context, 0, openIntent,
PendingIntent.FLAG_UPDATE_CURRENT or getPendingIntentFlagImmutable()
)
builder.setContentIntent(openPendingIntent)