Commit 75d7dfa8 authored by Ryan Hansberry's avatar Ryan Hansberry Committed by Commit Bot

[Bluetooth] OOBE: restrict activation of HID detection screen.

Only display and activate the HID detection screen for form
factors without built in input: Chromebases, Chromebits, and
Chromeboxes.

Bug: 965765
Change-Id: I9a5b8ac882e8fba74bef1c4d29e2c23dd563213b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758837
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695349}
parent f06c22da
......@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/system/sys_info.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/login/demo_mode/demo_setup_controller.h"
......@@ -153,7 +154,13 @@ class OobeConfigurationTest : public OobeBaseTest {
// EnterpriseEnrollmentConfigurationTest with no input devices.
class OobeConfigurationTestNoHID : public OobeConfigurationTest {
public:
OobeConfigurationTestNoHID() = default;
OobeConfigurationTestNoHID() {
// HID detection screen only appears for Chromebases, Chromebits, and
// Chromeboxes.
base::SysInfo::SetChromeOSVersionInfoForTest("DEVICETYPE=CHROMEBOX",
base::Time::Now());
}
~OobeConfigurationTestNoHID() override = default;
protected:
......
......@@ -5,6 +5,7 @@
#include <memory>
#include "base/macros.h"
#include "base/system/sys_info.h"
#include "chrome/browser/chromeos/login/oobe_screen.h"
#include "chrome/browser/chromeos/login/test/hid_controller_mixin.h"
#include "chrome/browser/chromeos/login/test/oobe_base_test.h"
......@@ -18,7 +19,13 @@ namespace chromeos {
class HidDetectionTest : public OobeBaseTest {
public:
HidDetectionTest() = default;
HidDetectionTest() {
// HID detection screen only appears for Chromebases, Chromebits, and
// Chromeboxes.
base::SysInfo::SetChromeOSVersionInfoForTest("DEVICETYPE=CHROMEBOX",
base::Time::Now());
}
~HidDetectionTest() override = default;
protected:
......
......@@ -131,6 +131,7 @@
#include "chromeos/constants/chromeos_constants.h"
#include "chromeos/constants/chromeos_features.h"
#include "chromeos/constants/chromeos_switches.h"
#include "chromeos/constants/devicetype.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager/session_manager_client.h"
#include "chromeos/geolocation/simple_geolocation_provider.h"
......@@ -188,14 +189,18 @@ const chromeos::StaticOobeScreenId kResumableScreens[] = {
chromeos::MultiDeviceSetupScreenView::kScreenId,
};
// Checks if device is in tablet mode, and that HID-detection screen is not
// disabled by flag.
// The HID detection screen is only allowed for form factors without built-in
// inputs: Chromebases, Chromebits, and Chromeboxes (crbug.com/965765).
bool CanShowHIDDetectionScreen() {
return !ash::TabletMode::Get()->InTabletMode() &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kDisableHIDDetectionOnOOBE) &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
ash::switches::kAshEnableTabletMode);
switch (chromeos::GetDeviceType()) {
case chromeos::DeviceType::kChromebase:
case chromeos::DeviceType::kChromebit:
case chromeos::DeviceType::kChromebox:
return !base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kDisableHIDDetectionOnOOBE);
default:
return false;
}
}
bool IsResumableScreen(chromeos::OobeScreenId screen) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment