A
A
Alexey2018-07-11 22:44:21
Android
Alexey, 2018-07-11 22:44:21

Why in Android 8.0 does the notification of a service running in foreground disappear on the lock screen?

I start the service as a foreground, respectively, its unhidden notification appears. But on the lock screen, the notification disappears, and instead a system notification appears: "App is running in the background. Tap for details ..."
This only happens in Android 8.0, in 8.1 the notification is back in place. Playing with CATEGORY, VISIBILITY, PRIORITY for notification and IMPORTANCE with setLockscreenVisibility() for his channel did nothing. Is this bug fixed in 8.0?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2018-07-13
@VDG

It turned out to be a studio bug, more specifically a bundle: Instant Run and Build Cache.
I accidentally noticed that the notification is displayed with a low priority of IMPORTANCE_MIN, although the source code contains IMPORTANCE_DEFAULT. That is, the old inactive code was running on the device, with IMPORTANCE_MIN once used. And, accordingly, the notification of the service was not displayed on the lock screen.
I note that rebuilding the project did not lead to anything, as well as deleting the notification channel and the application itself. Instant Run stubbornly took old dead code from the cache with IMPORTANCE_MIN and uploaded it to the device as it had just been compiled. Moreover, the cache was buggy only on 8.0, which was even more confusing. In short, only clearing this cache helped.

#
# artur #, 2014-11-16
@passshift

No, if the image is displayed on the page, then there is a direct link to it

B
Boris Benkovsky, 2014-11-16
@benbor

already been answered many times. learn to use google, so much faster
How to protect direct links?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question