SUPERCILEX / Robot-Scouter

:robot: Easy, efficient, and collaborative FIRST robot scouting
https://bit.ly/RobotScouter
GNU General Public License v3.0
107 stars 41 forks source link

Move last sign in update to ProcessLifecycleOwner onCreate #292

Closed SUPERCILEX closed 4 years ago

SUPERCILEX commented 4 years ago

Currently, we do it whenever the user is signed in: https://github.com/SUPERCILEX/Robot-Scouter/blob/c28662f70a6085e20549d6a68bdea77e25e7090d/library/core-data/src/main/java/com/supercilex/robotscouter/core/data/Database.kt#L163-L168

This is a problem because something like app indexing will periodically wake up our app even if the user isn't actually using it. ProcessLifecycleOwner will make sure at least one activity is open before we update user presence.