Adds support for android 12

This commit is contained in:
Eskilop 2022-01-28 17:03:09 +01:00
parent 153e6bd020
commit a5af8d81fa
No known key found for this signature in database
GPG key ID: 0A049F247520F615
2 changed files with 5 additions and 3 deletions

View file

@ -30,7 +30,8 @@
<!-- Main activity -->
<activity
android:name=".ui.MainActivity"
android:label="@string/app_name">
android:label="@string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
@ -62,7 +63,8 @@
<!-- Subscriber service restart on reboot -->
<receiver
android:name=".service.SubscriberService$BootStartReceiver"
android:enabled="true">
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>

View file

@ -268,7 +268,7 @@ class SubscriberService : Service() {
private fun createNotification(title: String, text: String): Notification {
val pendingIntent: PendingIntent = Intent(this, MainActivity::class.java).let { notificationIntent ->
PendingIntent.getActivity(this, 0, notificationIntent, 0)
PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE)
}
return NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_notification_instant)