Heads-up notifications on Android is a very useful feature. With this setting turned on, you’ll receive alert notifications for a short time at the top of your screen, so you don’t have to view them from the notification drawer every time. While you can turn this setting off entirely, there is no way to turn it off for specific apps only. However, there are phones like the Galaxy S8/S8+ and OnePlus 5 that have a game mode for certain apps that can block them. However, if you’re using stock Android or any other skin that doesn’t have such a mod, Here’s how to block Android alert notifications in any app:
Prerequisites to Block Android Heads-Up Notifications
Before you learn how to block alert notifications in games and video apps, there are a few things you’ll need in the process. Here is a list of these things for a smooth procedure:
- Download Tasker (7 day trial, $2.99) and one of its plugins called SafeMission (Free).
- Depending on the OEM of your device, first download USB drivers and then install them. If you’re not sure how to go about it, the same link has instructions for it.
- Download ADB Binary files according to your platform.
- Download 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 on “Build number” 7 times in a row.
Note: I’m using a computer with Windows 10 Pro and a rooted Moto G3 with a custom ROM and Android 7.1. The following method can also work with any non-rooted device.
How to Block Android Heads-Up Notifications in Games or Video Apps
When you think of any system tweaks not natively provided by Android, the first thing that comes to mind is Tasker. It’s a great app that lets you customize your phone beyond anything you can imagine, and most don’t even require root access. After you have taken care of the prerequisites, you can proceed with the steps outlined below.
- Go to “Developer options” on your phone and Enable usb debugging”. On some devices this may appear as “Android debugging”. You will be asked for a confirmation. Tap on “OK” and then plug your phone into your computer.
- On your computer, Extract ADB Binaries in a folder. I took it out on my desktop. Now open this extracted folder and right click anywhere on the screen while holding down the Shift key. You should now see an option called “Open PowerShell window here”. Click this.
note: If you’re not using the latest version of Windows, this option is called “Open command window here”. Also, you can open Terminal on Mac to complete the same process.
- In the PowerShell/Command Prompt window, type “adb devices” and press enter. If this is your first time doing this, you will get a prompt on your phone. Tap on “OK” to allow.
- Type “adb devices” again In the PowerShell window on your computer, then press enter. This should now list your phone as a connected device. If not, the drivers were not installed properly.
- Now, on your phone go to: Settings -> Accessibility -> Tasker. Open thisbecause Tasker will need it to recognize the app in use.
- After doing this open SafeMission and grant all necessary permissions. Now in the same Windows PowerShell/Command Prompt window on your computer, type “adb shell” and press enter. Follow this up by executing the following command:
pm ver com.balda.securetask android.permission.WRITE_SECURE_SETTINGS
- Go back to your phone and turn it on Officer. Under “Profiles” tab, tap the plus icon in the lower right corner of the screen, and then Choose “Application”.
- From the list of apps you see, select the ones you want to block alert notifications, and then go back. I selected Subway Surfers on my phone. Back in the Profiles tab, Tap on “New Mission”.
- You will now be asked to name it. You can choose to skip as it is optional. Finally, tap the checkmark is displayed on the screen. in the following “Task Edit” screen, tap the plus icon to add an action
- From the action category list Plugin –> Safe Task –> Safe Settings.
- Inside “Action Edit” following page, tap the edit icon against “Configuration”. The icon will be in the form of a pencil. After that, you may receive a warning. Ignore it and tap on “OK” to continue.
- You will now go to the configuration page for SecureTask. Here, change From “Action” to “Write”. Login now “New value” as ‘0’ and Type the following in the “Setting” section:
public head_up_notifications_enabled
- When you save this, go back Tasker home screenand below Profiles tab, long press in the text written to the right of the green arrow. From the menu that appears, Tap on “Add Output Task”. Again, you can choose to name this task and then tap the checkmark.
- Now, similar to the previous steps, tap the plus icon to add an action, go to: Plugin –> Safe Task –> Safe Settings. Change it again while editing the config From “Action” to “Write”enter and Same value as above in “Setting”. The only change in this step is Enter “new value” as ‘1’ instead of ‘0’. Save this before finally returning to Tasker’s home screen.
Now the next time you open any of these apps (Subway Surfers in my case), the alert notifications will be blocked automatically. And they will be enabled again when you exit the app. If you want to add or remove any application from this list, you can do so by tapping the list of available applications under the created profile.
SEE ALSO: How to Group Notifications by App in iOS 10
Disable Heads Up Notifications to Play Games and Watch Videos Comfortably
Considering how annoying it can be to get notifications on your screen while playing 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 completely block them for all apps. However, now that you’ve read this article, you can now block them for any app you want. Do you know of an easier method other than the one mentioned above? Let me know in the comments section below.
This tutorial was originally published at: XDA Developers. We tried it and it works fine.