Wednesday, September 6, 2017

How to Hide the “App is Running in the Background” Persistent Notification on Android Oreo

On Android Oreo, a notification which has been annoying users has been the "App is running in the background" notification. It appears whenever certain apps run in the background or overlay on the screen, such as Facebook Messenger or Twilight. The principle of the notification is good, but the application of it is not. The notification cannot be removed nor can it be disabled, so you have to put up with it taking up screen space in your notifications. That is, of course, if you're not willing to work around it. While it's not possible to permanently disable the notification without root access, it is possible to effectively permanently snooze the notification so you'll never see it again.

Annoying persistent notification in Android Oreo that we want to hide


Hiding the "App is Running in the Background" Notification in Android Oreo

Method 1 – Easiest

A developer by the name of iboalali has released an application specifically for blocking just this notification. The app is also completely open source! It only works on English language devices, at least for now, but the developer will likely add support for other languages as translations are added.

All you need to do is install the application, enable the Notification Listener permission, and it will keep the notification blocked!

Hide "running in the background" Notification (Free+, Google Play) →

Method 2 – Easy

The developer of AutoApps, Joao Dias, has informed us that he has released a beta update to his AutoNotification app that allows you to block this (and other) notifications without needing Tasker. Plus, he has gone ahead and made this new feature a free feature in his application so you can enjoy not seeing the "app is running in the background" notification without spending a single penny.

To get this, you'll first have to opt in to beta testing for his applications. Then, download AutoNotification from the Google Play Store.

AutoNotification (Free+, Google Play) →

Finally, watch this short video tutorial provided by Mr. Dias which will walk you through how to block the Android System notification using his app.

Method 3 – Harder

This fix was made by Marco Stornelli who is a developer of many free Tasker plugins under the BaldApps family. As published in this Reddit thread and shared below with his permission, this fix entails using the Tasker automation app as well as one of Marco's Tasker plugins called Notification Listener.

First, download these two applications. You'll need Tasker because it is necessary for Notification Listener to do its job, which in this case, will be to get rid of the background services persistent notification.

Tasker ($2.99, Google Play) →

Notification Listener (Free+, Google Play) →

Next, you'll want to import the Tasker profile that Marco provided. Download it here, then follow the screenshots below to learn how to import it and set it up!

Once the Task has been imported, you can run it to "snooze" the notification. It doesn't run at boot however, so follow the next steps below to learn how to run this Task at boot to block the notification automatically.

And now when you reboot your device, the profile should run at boot (well, not exactly at boot as technically it runs when Tasker's monitoring service starts, which is a few seconds after other boot receivers run)!

In case it isn't working, it's possible that the Android System notification is appearing after the Task has already run. In which case you can manually run the Task at boot, but the developer Marco recommends that you modify the query action to add a longer timeout, such as 3 minutes. Alternatively, you can add a "Wait" action at the beginning of the Task and use a similarly long timeout.

In case you only want to block this particular Android System notification (and not anything else it might post), you can instead change the Profile to be a "Notification Listener Event" with the "posted" condition, with the app targeting "Android System" and the title matching *background*. Note the use of asterisks there – this is a wildcard that matches any text surrounding the term "background" and thus will only match if the Android System is the "app is running in the background" notification.


Explanation

Without root, there is no way to actually prevent Android System from displaying the persistent "app is running in the background" notification in Android 8.0 Oreo. Looking at the source code for the ForegroundServiceController, its implementation, and the ForegroundServiceDialog doesn't really reveal anything we can take advantage of. As far as we know, there's no command or system property edit we can use to control whether or not this service runs. It seems that "Dianne's Dungeon" (likely a Google inside joke referring to senior Android engineer Dianne Hackborn) isn't something we can easily escape.

However, using any of the above methods is a relatively simple workaround for this issue. Each of these methods query for an "Android System" notification, which is a persistent notification created by the Android Framework app (package name "android"). If it exists, then it snoozes the notification from Android System for an absurdly long time. This modification is entirely safe to do by the way, as Android System usually doesn't provide any other notifications.



from xda-developers http://ift.tt/2wNdlE0
via IFTTT

No comments:

Post a Comment