Determine guest mode status for metrics collection

Modification to the function IsGuestMode. It returns true only if the guestfs
partition is mounted and the file /var/run/state/logged-in exits. Previously
it did not check for this file existence.

TEST=Log in in to guest mode right after installing recovery image and check
the absence of /home/chronos/prev_stats. Log out and log in as a user and
confirm the existence of this directory.

Change-Id: I7b0e7e8844332cca3fa67611b90fada3c5ba0eeb
Tested-by: Arkaitz Ruiz Alvarez <>
Reviewed-by: Darin Petkov <>
1 file changed
tree: 892e9b966378447e3021fe2fa3e86e2eec2d5901
  1. metrics/