If the app is in the foreground when (a) session is about to expire in 30 mins, or (b) session expires, or (c) when device wakes up and (a) or (b) is true, we show an alert instead of a notification
Since (2) above can result in multiple alerts, we keep track of whether a previous session-expiry-related alert is being shown or not. We show an alert only if another is not already being shown undismissed.
This PR does the following:
Fixes #442 and #445.