- FSI означает «Полноэкранное намерение»
- HUN означает «Head Up Notification»
- Samsung Galaxy S20 Plus (физическое устройство)
- Android 15
- One UI 7.0
- блокировка экрана с паролем
- Корея (Южная)
- Android Studio 2025. 2. 3.
- Я разрешил уведомление и FSI. Информацию о настройке уведомлений см. под изображением.
- Я выполняю все действия с помощью Jetpack Compose

Я запустил уведомление в приемнике сигнала тревоги.
- FSI при заблокированном экране работает хорошо. Показана активность.
- HUN, когда экран разблокирован, НЕ РАБОТАЕТ. Показано общее уведомление.
class AlarmReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
Log.i("receiver", "I received alarm broadcast")
val intent = Intent(context, AppointmentActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_NO_USER_ACTION
}
val pIndent = PendingIntent.getActivity(
context,
4,
intent,
PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
)
val notification = NotificationCompat.Builder(context, context.getString(R.string.appointment_notify_channel_id))
.setContentTitle("Title")
.setContentText("..and content")
.setSmallIcon(R.drawable.ansomi)
.setPriority(NotificationCompat.PRIORITY_MAX)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setCategory(NotificationCompat.CATEGORY_RECOMMENDATION)
.setFullScreenIntent(pIndent, true)
.build()
(context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).notify(
context.resources.getInteger(R.integer.APPOINTMENT_NOTIFY_ID), notification
)
Log.i("receiver", "WTF why not works?") // this log alayws print
}
}
// this code is part of Main Activity
override fun onResume() {
super.onResume()
if(!(getSystemService(ALARM_SERVICE) as AlarmManager).canScheduleExactAlarms()){
startActivity(
Intent().apply {
action = Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM
}
)
return
}else{
Log.i("Main Activity", "Exact Alarm is allowed")
}
if(!(getSystemService(NOTIFICATION_SERVICE) as NotificationManager).canUseFullScreenIntent()){
startActivity(
Intent().apply {
action = Settings.ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT
}
)
return
}else{
Log.i("Main Activity", "FSI allowed")
}
startActivity(Intent(this, TimerActivity::class.java)) // when all permission good, going to next activity
finish() // Main Activity just check permissions.
}
override fun onStart() {
super.onStart()
(getSystemService(NOTIFICATION_SERVICE) as NotificationManager).run {
listOf(R.string.foreground_notify_channel_id, R.string.timer_notify_channel_id, R.string.appointment_notify_channel_id).forEach{ id ->
deleteNotificationChannel(getString(id))
}
createNotificationChannels(
listOf(
NotificationChannel(
getString(R.string.foreground_notify_channel_id),
getString(R.string.foreground_notify_channel_name),
NotificationManager.IMPORTANCE_DEFAULT
),
NotificationChannel(
getString(R.string.timer_notify_channel_id),
getString(R.string.timer_notify_channel_name),
NotificationManager.IMPORTANCE_LOW
).apply {
enableVibration(false)
vibrationPattern = null
},
NotificationChannel(
getString(R.string.appointment_notify_channel_id),
getString(R.string.appointment_notify_channel_name),
NotificationManager.IMPORTANCE_HIGH
).apply {
enableVibration(true)
lockscreenVisibility = Notification.VISIBILITY_PUBLIC
}
)
)
}
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... ked-screen
Мобильная версия