login: Enable exo-pointer-lock on devices using borealis

Enabling the exo-pointer-lock flag on Borealis
enabled devices through the use of the borealis_host
use flag. We also check that the device isn't on stable or
beta.

BUG=b:169190751
TEST=Ran unit tests for chromeos-login

Change-Id: I1846fdd2b3412f270f8e6423b6ecce54e4eb6d24
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2485974
Reviewed-by: Chloe Pelling <cpelling@google.com>
Reviewed-by: Nic Hollingum <hollingum@google.com>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Tested-by: Chloe Pelling <cpelling@google.com>
Commit-Queue: Daniel Ng <danielng@google.com>
diff --git a/login_manager/chrome_setup.cc b/login_manager/chrome_setup.cc
index 0ae0633..acfc9eb 100644
--- a/login_manager/chrome_setup.cc
+++ b/login_manager/chrome_setup.cc
@@ -21,6 +21,7 @@
 #include <base/strings/string_number_conversions.h>
 #include <base/strings/string_split.h>
 #include <base/strings/stringprintf.h>
+#include <base/system/sys_info.h>
 #include <base/values.h>
 #include <brillo/userdb_utils.h>
 #include <chromeos-config/libcros_config/cros_config_interface.h>
@@ -244,6 +245,15 @@
 void AddBorealisFlags(ChromiumCommandBuilder* builder) {
   if (builder->UseFlagIsSet("borealis_host")) {
     builder->AddFeatureEnableOverride("Borealis");
+    // TODO(b/161952658): Remove the feature override for the exo-pointer lock
+    // when it is completed. This is only meant to be a temporary work-around.
+    std::string channel_string;
+    if (base::SysInfo::GetLsbReleaseValue("CHROMEOS_RELEASE_TRACK",
+                                          &channel_string) &&
+        channel_string != "beta-channel" &&
+        channel_string != "stable-channel") {
+      builder->AddFeatureEnableOverride("ExoPointerLock");
+    }
   }
 }