Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fdcf19a authored by Arkaitz Ruiz Alvarez's avatar Arkaitz Ruiz Alvarez Committed by Arkaitz Ruiz Alvarez
Browse files

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.

BUG=chromium-os:15763
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-on: http://gerrit.chromium.org/gerrit/1586


Reviewed-by: default avatarDarin Petkov <petkov@chromium.org>
Tested-by: default avatarArkaitz Ruiz Alvarez <arkaitzr@google.com>
parent 8accd33d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -126,7 +126,7 @@ bool MetricsLibrary::IsGuestMode() {
                       &result)) {
                       &result)) {
    return false;
    return false;
  }
  }
  return result;
  return result && access("/var/run/state/logged-in", F_OK) == 0;
}
}


bool MetricsLibrary::AreMetricsEnabled() {
bool MetricsLibrary::AreMetricsEnabled() {