Post the drawer's row behind the app's own banner
A notification arriving while the app was open was shown as a banner and nowhere else, so a moment that happened while the phone was face-up on a desk left nothing behind at all -- the banner is seconds long and reaches only somebody already looking. The two are not two versions of one thing: a banner interrupts and a row records. Both go up now, and the banner having done the interrupting is what makes the row a silent one (`setSilent`), so one moment is worth a noise once. What keeps the drawer from filling up is the other end rather than suppression, and already was: opening a session clears whatever is posted about it, whichever way the reader got there. Checked with ktfmtFormat, compileDebugKotlin, testDebugUnitTest and lintDebug, and on the emulator against the sandbox, reading the posted record out of dumpsys: app on the session list gives a banner and flags=AUTO_CANCEL|SILENT; app backgrounded gives flags=AUTO_CANCEL; opening the session leaves nothing posted about it in either case.
This commit is contained in:
1 parent
1e52b2910c
commit
0be15adbee
3 files changed
+45
-26
No files matched your search
@@ -31,13 +31,13 @@ import androidx.lifecycle.compose.LocalLifecycleOwner
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
|
||||
/**
|
||||
* A session wanting attention, said over the app rather than through Android's drawer.
|
||||
* A session wanting attention, said over the app as well as in Android's drawer.
|
||||
*
|
||||
* Two places can carry the same fact and only one is right at a time. A row in the shade is for
|
||||
* somebody looking at something else: it makes a sound, it waits however long it has to, and acting
|
||||
* on it means leaving whatever they were doing. Somebody with this app open needs none of that. So
|
||||
* while these are on screen the stream is delivered here instead, which is arranged by the
|
||||
* collection below and nothing else.
|
||||
* Two places carry the same fact and they are doing different jobs: a row in the shade waits
|
||||
* however long it has to, which makes it the record, and a banner is read now or not at all, which
|
||||
* makes it the interruption. So somebody with the app open gets both -- this, and a silent row
|
||||
* behind it that is still there when they go looking and goes by itself when they open the session.
|
||||
* Whether the app is open at all is this collection and nothing else.
|
||||
*
|
||||
* A banner can go three ways, each somebody deciding something different: tapped, which opens the
|
||||
* session; pushed off either side; or left alone, in which case it goes when the bar runs out.
|
||||
|
||||
Reference in new issue
Block a user