I am having an alarm app that sets alarm using following code for devices on Marshmallow and higher:
val alarmIntent: PendingIntent = Intent(context, AlarmReceiver::class.java).let { intent ->
intent.putExtra(Const.EXTRA_ALARM_ID, alarm.alarmId)
PendingIntent.getBroadcast(context,
alarm.calculateBroadcastId(dayOfWeek),
intent,
PendingIntent.FLAG_UPDATE_CURRENT)
}
alarmManager.setAlarmClock(
AlarmManager.AlarmClockInfo(calendar.timeInMillis, alarmIntent),
preAlarmIntent)
It works as expected and shows alarm icon in top right corner (see attachment) on all devices except those devices running Android Pie.
UPDATE: Not on all devices running Android Pie, just Samsung (S8) so far.
Is there any additional code that I should add into the pending intent or somewhere in order to show this icon?
Photo of the device running Android Oreo (OS 8.1) and showing alarm icon as expected:

In android Pie restrictions are introduced on the apps running in background.
This is due to new features introduced to improve device power management.
These features are explained in android developer documents in detail.
You can check details in this Link.
Hope it helps you !