|
YAACC - UPNP Client and Server
|
Decides whether a start that comes right after an explicit exit (exit button, shutdown timer, idle timer) is a start the user wanted or the system bringing the app back (task 12.2). More...

Classes | |
| enum | Decision |
| What the starting side does. More... | |
| enum | StartReason |
| Why something starts. More... | |
| interface | Store |
| Where the mark is kept (survives the process). More... | |
Public Member Functions | |
| ExitRestartGuard (Store store, LongSupplier clock) | |
| void | markExitRequested () |
| Called first thing in the exit, before anything is stopped. | |
| void | clearOnUserStart () |
| Called when the user starts the app: whatever starts later is a normal start. | |
| Decision | decide (StartReason reason) |
| What a start for this reason does now. | |
Static Public Member Functions | |
| static Decision | decide (long exitRequestedAtMillis, long nowMillis, StartReason reason) |
| The decision itself, without a store. | |
Decides whether a start that comes right after an explicit exit (exit button, shutdown timer, idle timer) is a start the user wanted or the system bringing the app back (task 12.2).
The exit marks the time it was asked for before anything is stopped, and the mark is persisted (the process ends right after). What the system does afterwards can not be controlled from the process (a sticky restart of a service, a new process for some other reason, and every new process starts the UPnP server service), so the starting side asks: an sticky restart, a process start or a restored screen within WINDOW_MILLIS of the mark stops itself. A start by the user (StartReason#USER_LAUNCH) is never blocked and clears the mark, so a later start by anything is a normal start; the window is the second safety, the mark never blocks for long even if nobody clears it. A boot is a new session and always starts (the autostart is the user's choice).
Fails open: a store that can not be read or written never blocks a start and never makes the exit fail.
| void de.yaacc.util.ExitRestartGuard.clearOnUserStart | ( | ) |
Called when the user starts the app: whatever starts later is a normal start.
Never throws.
Referenced by de.yaacc.Yaacc.userStarted().


| Decision de.yaacc.util.ExitRestartGuard.decide | ( | StartReason | reason | ) |
What a start for this reason does now.
Never throws; an unreadable store allows the start; after a user start in this process always START.

| void de.yaacc.util.ExitRestartGuard.markExitRequested | ( | ) |
Called first thing in the exit, before anything is stopped.
Never throws.
Referenced by de.yaacc.Yaacc.exit().

