Background
Since the heads-up notification appeared on Android, some people liked its quick control, but some hated it for showing applications (especially games).
To display heads-up notifications, developers can use something like this:
final NotificationCompat.Builder builder = new NotificationCompat.Builder(this) .setContentTitle("aa").setContentText("bb").setTicker("cc") .setColor(0xffff0000).setSmallIcon(R.mipmap.ic_launcher) .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher)) .setPriority(Notification.PRIORITY_HIGH); if (Build.VERSION.SDK_INT >= 21) builder.setVibrate(new long[0]); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(1, builder.build());
In this regard, in some applications the idea appeared to show ticker text notifications that somehow replace them, just as before, before head-notifications:
https://play.google.com/store/apps/details?id=com.jamworks.noheadsup&hl=en
There are various scenarios where this may be useful. This can be, for example, useful in the case of games that use full screen. This is because if the user is about to click on the top area and heads-up notifications are shown, we would like to avoid accidentally clicking on this notification.
Problem
Not only can I not find a way how people did it, but it seems that it no longer works in new versions of Android (tested on Android 7).
The only application I discovered is block notification: https://play.google.com/store/apps/details?id=com.aboutmycode.NotificationsOff&hl=en
but it doesn’t convert heads-up notifications to “regular.” Instead, it simply blocks them all. In addition, it requires root, and it seems to just change the notification settings to “locked”.
Question
Is it possible to temporarily block notifications about heads (and still convert them to those who do not have heads-up notifications)? If so, how?
What are the limitations? Can it work without root? If possible with root, how? How does "NotificationsOff" work?
Perhaps this opportunity was possible earlier, but now it is not so?