Suppress matched native notification alerts

This commit is contained in:
ajp_anton
2026-08-18 05:25:48 +00:00
parent 7166cfe18b
commit 68771d5836
13 changed files with 341 additions and 85 deletions
@@ -6,6 +6,8 @@ import android.app.NotificationManager
import android.app.Person
import android.content.Intent
import android.graphics.Bitmap
import android.media.AudioAttributes
import android.media.RingtoneManager
import android.os.Bundle
import android.widget.Button
import android.widget.LinearLayout
@@ -21,7 +23,16 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(state: Bundle?) {
super.onCreate(state)
manager.createNotificationChannel(NotificationChannel(CHANNEL, "Test", NotificationManager.IMPORTANCE_DEFAULT))
manager.createNotificationChannel(
NotificationChannel(CHANNEL, "Test", NotificationManager.IMPORTANCE_HIGH).apply {
setSound(
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION),
AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build(),
)
enableVibration(true)
vibrationPattern = longArrayOf(0, 200)
},
)
setContentView(ScrollView(this).apply {
addView(LinearLayout(this@MainActivity).apply {
orientation = LinearLayout.VERTICAL