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: I29c66642ba590e882e6ec7a02732e818c87ac2ad
Reviewed-by: Darin Petkov <>
Tested-by: Arkaitz Ruiz Alvarez <>
1 file changed
tree: 122e0cec2af7521293206b8d7413518b28ef933d
  1. metrics/