Heads-up notifications on Android is a very useful feature. While this setting is on, you get heads-up notifications on the top of your screen for a small duration, thus saving you the effort of viewing them from the notification drawer every time. Though you may turn off this setting completely, there is no way to turn it off for only some particular apps. Having said that, there are phones out there like the Galaxy S8/S8+ and the OnePlus 5 which have a game mode that can block them for selected apps. However, if you use stock Android or any other skin that does not feature such a mode, here is how to block Android heads-up notifications in any app:
Prerequisites to Block Android Heads-Up Notifications
Before we learn how to block heads-up notifications while in games and video apps, there are a few things that you will require in the process. Here is a list of those things for a seamless procedure:
- Download Tasker (7-day trial, $2.99) and one of its plugins called SecureTask (free).
- Depending on your device OEM, first download the USB drivers and then install them. If you are unsure of how to go about that, the same link has the guidelines for that.
- Download the ADB Binary files according to your platform.
- Download a software like WinRAR to extract compressed files and folders.
- Enable Developer Options on your Android device. You can do this by going to Settings –> About phone, and tapping 7 times in succession on “Build number”.
Note: I am using a computer with Windows 10 Pro and a rooted Moto G3 with a custom ROM and Android 7.1.1. The following method can work with any non-rooted device as well.
How to Block Android Heads-Up Notifications in Games or Video Apps
When you think of any system tweaks that are not natively provided by Android, the first thing that comes to your mind is Tasker. It is a great app that lets you customize your phone beyond what you can imagine – and most of them don’t even require a root access. Once you have taken care of the prerequisites, you can proceed with the steps mentioned below.
- In your phone, go to “Developer options” and enable “USB debugging”. In some devices, this may appear as “Android debugging”. You will be prompted for a confirmation. Tap on “OK” and then plug in your phone to your computer.
- On your computer, extract the ADB Binary files in a folder. I extracted it on my desktop. Now open this extracted folder and while holding the Shift key, right-click anywhere on the screen. You should now see an option called “Open PowerShell window here”. Click on this.
Note: If you are not using the latest build of Windows, this option would be called “Open command window here”. Also, you can open up Terminal on Mac to complete the same process.
- In the PowerShell/Command Prompt window, type “adb devices” and hit enter. If this was the was first time you did this, you’ll get a prompt on your phone. Tap on “OK” to allow it.
- Again type “adb devices” in the PowerShell window on your computer followed by hitting enter. This should now list your phone as an attached device. If it doesn’t, the drivers didn’t get installed properly.
- Now, on your phone, go to Settings –> Accessibility –> Tasker. Toggle this on, as this will be needed by Tasker in order to recognize the app in use.
- After you do this, open SecureTask and grant all the permissions it requires. Now, back on your computer, in the same Windows PowerShell/Command Prompt window, type “adb shell” and hit enter. Follow this by execution of the following command:
pm grant com.balda.securetask android.permission.WRITE_SECURE_SETTINGS
- Go back to your phone and open Tasker. Under the “Profiles” tab, tap on the plus icon on the bottom-right of the screen and then choose “Application”.
- From the list of apps that you see, select the ones for which you want to block the heads-up notifications, and then go back. I selected Subway Surfers on my phone. When you come back to the Profiles tab, tap on “New Task”.
- You’ll now be prompted to name it. As it is optional, you can choose to skip it. Finally, tap on the check mark displayed on the screen. In the following “Task Edit” screen, tap on the plus icon to add an action.
- From the action category list, select Plugin –> Secure Task –> Secure Settings.
- In the “Action Edit” page that follows, tap on the edit icon against “Configuration”. The icon will be shaped as a pencil. You may get a warning after this. Ignore it and tap on “OK” to continue.
- You’ll now land on the configuration page for SecureTask. Here, change the “Action” to “Write”. Now input “New value” as ‘0’ and type the following in “Setting”:
- When you save this, go back to the main screen of Tasker, and under the Profiles tab, long press on the text written on the right-hand side of the green arrow. From the menu that appears, tap on “Add Exit Task”. Again, you can choose to name this task and then tap on the check mark.
- Now, similar to the previous steps, tap on the plus icon to add an action, go to Plugin –> Secure Task –> Secure Settings. While editing configuration, again change “Action” to “Write”, and enter the same value as above in “Setting”. The only change in this step is to enter the “New value” as ‘1’ instead of ‘0’. Save this before finally going back to the main screen of Tasker.
Now the next time you open any of these apps (Subway Surfers in my case), the heads-up notifications would be blocked automatically. And when you exit the app, they’ll be enabled again. If you ever want to add or remove any of the apps to this list, you can do that by tapping on the list of existing apps under the created profile.
Disable Heads Up Notifications to Play Games and Watch Videos Conveniently
Given that how irritating it can be to get notifications on your screen when you are playing on a game or watching a video, it only makes sense to block them. But the only option you’ll find in your phone’s settings is to block them completely – for all the apps. However, now that you have read this article, you can now block them for any particular app that you want. Apart from the aforementioned method, is there any easier method that you know of? Do let me know in the comments section below.
This tutorial was first posted on XDA Developers. We tried it out and it works without any problems.