Commit 760af742 authored by Alexei Svitkine's avatar Alexei Svitkine Committed by Commit Bot

Remove bluetooth information logging to UMA on CrOS.

The data reported is not useful and there are plans to revamp
this information with something more actionable.

Bug: 1072801
Change-Id: I21bbf56dd8d221fb795824eb432fea7f122059bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2157835Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760982}
parent 8bf30ec1
...@@ -45,9 +45,6 @@ ...@@ -45,9 +45,6 @@
#include "components/user_manager/user_type.h" #include "components/user_manager/user_type.h"
#include "components/variations/hashing.h" #include "components/variations/hashing.h"
#include "components/variations/service/variations_field_trial_creator.h" #include "components/variations/service/variations_field_trial_creator.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/bluetooth_device.h"
#include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h" #include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h"
#include "ui/display/display.h" #include "ui/display/display.h"
#include "ui/events/event_utils.h" #include "ui/events/event_utils.h"
...@@ -55,47 +52,9 @@ ...@@ -55,47 +52,9 @@
using metrics::ChromeUserMetricsExtension; using metrics::ChromeUserMetricsExtension;
using metrics::SampledProfile; using metrics::SampledProfile;
using metrics::SystemProfileProto; using metrics::SystemProfileProto;
typedef SystemProfileProto::Hardware::Bluetooth::PairedDevice PairedDevice;
namespace { namespace {
PairedDevice::Type AsBluetoothDeviceType(
device::BluetoothDeviceType device_type) {
switch (device_type) {
case device::BluetoothDeviceType::UNKNOWN:
return PairedDevice::DEVICE_UNKNOWN;
case device::BluetoothDeviceType::COMPUTER:
return PairedDevice::DEVICE_COMPUTER;
case device::BluetoothDeviceType::PHONE:
return PairedDevice::DEVICE_PHONE;
case device::BluetoothDeviceType::MODEM:
return PairedDevice::DEVICE_MODEM;
case device::BluetoothDeviceType::AUDIO:
return PairedDevice::DEVICE_AUDIO;
case device::BluetoothDeviceType::CAR_AUDIO:
return PairedDevice::DEVICE_CAR_AUDIO;
case device::BluetoothDeviceType::VIDEO:
return PairedDevice::DEVICE_VIDEO;
case device::BluetoothDeviceType::PERIPHERAL:
return PairedDevice::DEVICE_PERIPHERAL;
case device::BluetoothDeviceType::JOYSTICK:
return PairedDevice::DEVICE_JOYSTICK;
case device::BluetoothDeviceType::GAMEPAD:
return PairedDevice::DEVICE_GAMEPAD;
case device::BluetoothDeviceType::KEYBOARD:
return PairedDevice::DEVICE_KEYBOARD;
case device::BluetoothDeviceType::MOUSE:
return PairedDevice::DEVICE_MOUSE;
case device::BluetoothDeviceType::TABLET:
return PairedDevice::DEVICE_TABLET;
case device::BluetoothDeviceType::KEYBOARD_MOUSE_COMBO:
return PairedDevice::DEVICE_KEYBOARD_MOUSE_COMBO;
}
NOTREACHED();
return PairedDevice::DEVICE_UNKNOWN;
}
void IncrementPrefValue(const char* path) { void IncrementPrefValue(const char* path) {
PrefService* pref = g_browser_process->local_state(); PrefService* pref = g_browser_process->local_state();
DCHECK(pref); DCHECK(pref);
...@@ -187,9 +146,8 @@ void ChromeOSMetricsProvider::Init() { ...@@ -187,9 +146,8 @@ void ChromeOSMetricsProvider::Init() {
void ChromeOSMetricsProvider::AsyncInit(base::OnceClosure done_callback) { void ChromeOSMetricsProvider::AsyncInit(base::OnceClosure done_callback) {
base::RepeatingClosure barrier = base::RepeatingClosure barrier =
base::BarrierClosure(3, std::move(done_callback)); base::BarrierClosure(2, std::move(done_callback));
InitTaskGetFullHardwareClass(barrier); InitTaskGetFullHardwareClass(barrier);
InitTaskGetBluetoothAdapter(barrier);
InitTaskGetArcFeatures(barrier); InitTaskGetArcFeatures(barrier);
} }
...@@ -216,13 +174,6 @@ void ChromeOSMetricsProvider::InitTaskGetFullHardwareClass( ...@@ -216,13 +174,6 @@ void ChromeOSMetricsProvider::InitTaskGetFullHardwareClass(
weak_ptr_factory_.GetWeakPtr(), std::move(callback))); weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
} }
void ChromeOSMetricsProvider::InitTaskGetBluetoothAdapter(
base::OnceClosure callback) {
device::BluetoothAdapterFactory::GetAdapter(
base::BindOnce(&ChromeOSMetricsProvider::SetBluetoothAdapter,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
void ChromeOSMetricsProvider::InitTaskGetArcFeatures( void ChromeOSMetricsProvider::InitTaskGetArcFeatures(
base::OnceClosure callback) { base::OnceClosure callback) {
arc::ArcFeaturesParser::GetArcFeatures( arc::ArcFeaturesParser::GetArcFeatures(
...@@ -232,7 +183,6 @@ void ChromeOSMetricsProvider::InitTaskGetArcFeatures( ...@@ -232,7 +183,6 @@ void ChromeOSMetricsProvider::InitTaskGetArcFeatures(
void ChromeOSMetricsProvider::ProvideSystemProfileMetrics( void ChromeOSMetricsProvider::ProvideSystemProfileMetrics(
metrics::SystemProfileProto* system_profile_proto) { metrics::SystemProfileProto* system_profile_proto) {
WriteBluetoothProto(system_profile_proto);
WriteLinkedAndroidPhoneProto(system_profile_proto); WriteLinkedAndroidPhoneProto(system_profile_proto);
UpdateMultiProfileUserCount(system_profile_proto); UpdateMultiProfileUserCount(system_profile_proto);
...@@ -308,67 +258,6 @@ void ChromeOSMetricsProvider::ProvideCurrentSessionData( ...@@ -308,67 +258,6 @@ void ChromeOSMetricsProvider::ProvideCurrentSessionData(
UpdateUserTypeUMA(); UpdateUserTypeUMA();
} }
void ChromeOSMetricsProvider::WriteBluetoothProto(
metrics::SystemProfileProto* system_profile_proto) {
// This may be called before the async init task to set |adapter_| is set,
// such as when the persistent system profile gets filled in initially.
if (!adapter_)
return;
metrics::SystemProfileProto::Hardware* hardware =
system_profile_proto->mutable_hardware();
SystemProfileProto::Hardware::Bluetooth* bluetooth =
hardware->mutable_bluetooth();
bluetooth->set_is_present(adapter_->IsPresent());
bluetooth->set_is_enabled(adapter_->IsPowered());
device::BluetoothAdapter::DeviceList devices = adapter_->GetDevices();
for (device::BluetoothAdapter::DeviceList::iterator iter = devices.begin();
iter != devices.end();
++iter) {
device::BluetoothDevice* device = *iter;
// Don't collect information about LE devices yet.
if (!device->IsPaired())
continue;
PairedDevice* paired_device = bluetooth->add_paired_device();
paired_device->set_bluetooth_class(device->GetBluetoothClass());
paired_device->set_type(AsBluetoothDeviceType(device->GetDeviceType()));
// |address| is xx:xx:xx:xx:xx:xx, extract the first three components and
// pack into a uint32_t.
std::string address = device->GetAddress();
if (address.size() > 9 && address[2] == ':' && address[5] == ':' &&
address[8] == ':') {
std::string vendor_prefix_str;
uint64_t vendor_prefix;
base::RemoveChars(address.substr(0, 9), ":", &vendor_prefix_str);
DCHECK_EQ(6U, vendor_prefix_str.size());
base::HexStringToUInt64(vendor_prefix_str, &vendor_prefix);
paired_device->set_vendor_prefix(vendor_prefix);
}
switch (device->GetVendorIDSource()) {
case device::BluetoothDevice::VENDOR_ID_BLUETOOTH:
paired_device->set_vendor_id_source(PairedDevice::VENDOR_ID_BLUETOOTH);
break;
case device::BluetoothDevice::VENDOR_ID_USB:
paired_device->set_vendor_id_source(PairedDevice::VENDOR_ID_USB);
break;
default:
paired_device->set_vendor_id_source(PairedDevice::VENDOR_ID_UNKNOWN);
}
paired_device->set_vendor_id(device->GetVendorID());
paired_device->set_product_id(device->GetProductID());
paired_device->set_device_id(device->GetDeviceID());
}
}
void ChromeOSMetricsProvider::WriteLinkedAndroidPhoneProto( void ChromeOSMetricsProvider::WriteLinkedAndroidPhoneProto(
metrics::SystemProfileProto* system_profile_proto) { metrics::SystemProfileProto* system_profile_proto) {
chromeos::multidevice_setup::MultiDeviceSetupClient* client = chromeos::multidevice_setup::MultiDeviceSetupClient* client =
...@@ -420,13 +309,6 @@ void ChromeOSMetricsProvider::UpdateMultiProfileUserCount( ...@@ -420,13 +309,6 @@ void ChromeOSMetricsProvider::UpdateMultiProfileUserCount(
} }
} }
void ChromeOSMetricsProvider::SetBluetoothAdapter(
base::OnceClosure callback,
scoped_refptr<device::BluetoothAdapter> adapter) {
adapter_ = adapter;
std::move(callback).Run();
}
void ChromeOSMetricsProvider::SetFullHardwareClass( void ChromeOSMetricsProvider::SetFullHardwareClass(
base::OnceClosure callback, base::OnceClosure callback,
std::string full_hardware_class) { std::string full_hardware_class) {
......
...@@ -18,10 +18,6 @@ namespace arc { ...@@ -18,10 +18,6 @@ namespace arc {
struct ArcFeatures; struct ArcFeatures;
} }
namespace device {
class BluetoothAdapter;
}
namespace features { namespace features {
extern const base::Feature kUmaShortHWClass; extern const base::Feature kUmaShortHWClass;
} }
...@@ -62,10 +58,6 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider { ...@@ -62,10 +58,6 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider {
// is run. // is run.
void InitTaskGetFullHardwareClass(base::OnceClosure callback); void InitTaskGetFullHardwareClass(base::OnceClosure callback);
// Creates the Bluetooth adapter. When this task is complete, |callback| is
// run.
void InitTaskGetBluetoothAdapter(base::OnceClosure callback);
// Retrieves ARC features using ArcFeaturesParser. When this task is complete, // Retrieves ARC features using ArcFeaturesParser. When this task is complete,
// |callback| is run. // |callback| is run.
void InitTaskGetArcFeatures(base::OnceClosure callback); void InitTaskGetArcFeatures(base::OnceClosure callback);
...@@ -90,11 +82,6 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider { ...@@ -90,11 +82,6 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider {
void UpdateMultiProfileUserCount( void UpdateMultiProfileUserCount(
metrics::SystemProfileProto* system_profile_proto); metrics::SystemProfileProto* system_profile_proto);
// Sets the Bluetooth Adapter instance used for the WriteBluetoothProto()
// call and calls callback.
void SetBluetoothAdapter(base::OnceClosure callback,
scoped_refptr<device::BluetoothAdapter> adapter);
// Sets the full hardware class, then calls the callback. // Sets the full hardware class, then calls the callback.
void SetFullHardwareClass(base::OnceClosure callback, void SetFullHardwareClass(base::OnceClosure callback,
std::string full_hardware_class); std::string full_hardware_class);
...@@ -103,9 +90,6 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider { ...@@ -103,9 +90,6 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider {
void OnArcFeaturesParsed(base::OnceClosure callback, void OnArcFeaturesParsed(base::OnceClosure callback,
base::Optional<arc::ArcFeatures> features); base::Optional<arc::ArcFeatures> features);
// Writes info about paired Bluetooth devices on this system.
void WriteBluetoothProto(metrics::SystemProfileProto* system_profile_proto);
// Called from the ProvideCurrentSessionData(...) to record UserType. // Called from the ProvideCurrentSessionData(...) to record UserType.
void UpdateUserTypeUMA(); void UpdateUserTypeUMA();
...@@ -119,9 +103,6 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider { ...@@ -119,9 +103,6 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider {
// Use the first signed-in profile for profile-dependent metrics. // Use the first signed-in profile for profile-dependent metrics.
std::unique_ptr<metrics::CachedMetricsProfile> cached_profile_; std::unique_ptr<metrics::CachedMetricsProfile> cached_profile_;
// Bluetooth Adapter instance for collecting information about paired devices.
scoped_refptr<device::BluetoothAdapter> adapter_;
// Whether the user count was registered at the last log initialization. // Whether the user count was registered at the last log initialization.
bool registered_user_count_at_log_initialization_; bool registered_user_count_at_log_initialization_;
......
...@@ -27,34 +27,9 @@ ...@@ -27,34 +27,9 @@
#include "components/user_manager/user_manager.h" #include "components/user_manager/user_manager.h"
#include "content/public/test/browser_task_environment.h" #include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h"
#include "device/bluetooth/dbus/fake_bluetooth_agent_manager_client.h"
#include "device/bluetooth/dbus/fake_bluetooth_device_client.h"
#include "device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h"
#include "device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_client.h"
#include "device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h"
#include "device/bluetooth/dbus/fake_bluetooth_input_client.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/system_profile.pb.h" #include "third_party/metrics_proto/system_profile.pb.h"
using bluez::BluetoothAdapterClient;
using bluez::BluetoothAgentManagerClient;
using bluez::BluetoothDeviceClient;
using bluez::BluetoothGattCharacteristicClient;
using bluez::BluetoothGattDescriptorClient;
using bluez::BluetoothGattServiceClient;
using bluez::BluetoothInputClient;
using bluez::BluezDBusManager;
using bluez::BluezDBusManagerSetter;
using bluez::FakeBluetoothAdapterClient;
using bluez::FakeBluetoothAgentManagerClient;
using bluez::FakeBluetoothDeviceClient;
using bluez::FakeBluetoothGattCharacteristicClient;
using bluez::FakeBluetoothGattDescriptorClient;
using bluez::FakeBluetoothGattServiceClient;
using bluez::FakeBluetoothInputClient;
namespace { namespace {
class FakeMultiDeviceSetupClientImplFactory class FakeMultiDeviceSetupClientImplFactory
...@@ -84,7 +59,7 @@ class FakeMultiDeviceSetupClientImplFactory ...@@ -84,7 +59,7 @@ class FakeMultiDeviceSetupClientImplFactory
}; };
// Wrapper around ChromeOSMetricsProvider that initializes // Wrapper around ChromeOSMetricsProvider that initializes
// Bluetooth and hardware class in the constructor. // hardware class in the constructor.
class TestChromeOSMetricsProvider : public ChromeOSMetricsProvider { class TestChromeOSMetricsProvider : public ChromeOSMetricsProvider {
public: public:
TestChromeOSMetricsProvider() TestChromeOSMetricsProvider()
...@@ -108,38 +83,9 @@ class ChromeOSMetricsProviderTest : public testing::Test { ...@@ -108,38 +83,9 @@ class ChromeOSMetricsProviderTest : public testing::Test {
protected: protected:
void SetUp() override { void SetUp() override {
// Set up the fake Bluetooth environment,
std::unique_ptr<BluezDBusManagerSetter> bluez_dbus_setter =
BluezDBusManager::GetSetterForTesting();
bluez_dbus_setter->SetBluetoothAdapterClient(
std::unique_ptr<BluetoothAdapterClient>(
new FakeBluetoothAdapterClient));
bluez_dbus_setter->SetBluetoothDeviceClient(
std::unique_ptr<BluetoothDeviceClient>(new FakeBluetoothDeviceClient));
bluez_dbus_setter->SetBluetoothGattCharacteristicClient(
std::unique_ptr<BluetoothGattCharacteristicClient>(
new FakeBluetoothGattCharacteristicClient));
bluez_dbus_setter->SetBluetoothGattDescriptorClient(
std::unique_ptr<BluetoothGattDescriptorClient>(
new FakeBluetoothGattDescriptorClient));
bluez_dbus_setter->SetBluetoothGattServiceClient(
std::unique_ptr<BluetoothGattServiceClient>(
new FakeBluetoothGattServiceClient));
bluez_dbus_setter->SetBluetoothInputClient(
std::unique_ptr<BluetoothInputClient>(new FakeBluetoothInputClient));
bluez_dbus_setter->SetBluetoothAgentManagerClient(
std::unique_ptr<BluetoothAgentManagerClient>(
new FakeBluetoothAgentManagerClient));
// Set up a PowerManagerClient instance for PerfProvider. // Set up a PowerManagerClient instance for PerfProvider.
chromeos::PowerManagerClient::InitializeFake(); chromeos::PowerManagerClient::InitializeFake();
// Grab pointers to members of the thread manager for easier testing.
fake_bluetooth_adapter_client_ = static_cast<FakeBluetoothAdapterClient*>(
BluezDBusManager::Get()->GetBluetoothAdapterClient());
fake_bluetooth_device_client_ = static_cast<FakeBluetoothDeviceClient*>(
BluezDBusManager::Get()->GetBluetoothDeviceClient());
chromeos::multidevice_setup::MultiDeviceSetupClientFactory::GetInstance() chromeos::multidevice_setup::MultiDeviceSetupClientFactory::GetInstance()
->SetServiceIsNULLWhileTestingForTesting(false); ->SetServiceIsNULLWhileTestingForTesting(false);
auto fake_multidevice_setup_client = std::make_unique< auto fake_multidevice_setup_client = std::make_unique<
...@@ -177,8 +123,6 @@ class ChromeOSMetricsProviderTest : public testing::Test { ...@@ -177,8 +123,6 @@ class ChromeOSMetricsProviderTest : public testing::Test {
} }
protected: protected:
FakeBluetoothAdapterClient* fake_bluetooth_adapter_client_;
FakeBluetoothDeviceClient* fake_bluetooth_device_client_;
chromeos::multidevice_setup::FakeMultiDeviceSetupClient* chromeos::multidevice_setup::FakeMultiDeviceSetupClient*
fake_multidevice_setup_client_; fake_multidevice_setup_client_;
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
...@@ -245,119 +189,6 @@ TEST_F(ChromeOSMetricsProviderTest, MultiProfileCountInvalidated) { ...@@ -245,119 +189,6 @@ TEST_F(ChromeOSMetricsProviderTest, MultiProfileCountInvalidated) {
EXPECT_EQ(0u, system_profile.multi_profile_user_count()); EXPECT_EQ(0u, system_profile.multi_profile_user_count());
} }
TEST_F(ChromeOSMetricsProviderTest, BluetoothHardwareDisabled) {
TestChromeOSMetricsProvider provider;
provider.OnDidCreateMetricsLog();
metrics::SystemProfileProto system_profile;
provider.ProvideSystemProfileMetrics(&system_profile);
EXPECT_TRUE(system_profile.has_hardware());
EXPECT_TRUE(system_profile.hardware().has_bluetooth());
EXPECT_TRUE(system_profile.hardware().bluetooth().is_present());
EXPECT_FALSE(system_profile.hardware().bluetooth().is_enabled());
}
TEST_F(ChromeOSMetricsProviderTest, BluetoothHardwareEnabled) {
FakeBluetoothAdapterClient::Properties* properties =
fake_bluetooth_adapter_client_->GetProperties(
dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath));
properties->powered.ReplaceValue(true);
TestChromeOSMetricsProvider provider;
metrics::SystemProfileProto system_profile;
provider.ProvideSystemProfileMetrics(&system_profile);
EXPECT_TRUE(system_profile.has_hardware());
EXPECT_TRUE(system_profile.hardware().has_bluetooth());
EXPECT_TRUE(system_profile.hardware().bluetooth().is_present());
EXPECT_TRUE(system_profile.hardware().bluetooth().is_enabled());
}
TEST_F(ChromeOSMetricsProviderTest, BluetoothPairedDevices) {
// The fake bluetooth adapter class already claims to be paired with two
// device when initialized. Add a third and fourth fake device to it so we
// can test the cases where a device is not paired (LE device, generally)
// and a device that does not have Device ID information.
fake_bluetooth_device_client_->CreateDevice(
dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(FakeBluetoothDeviceClient::kRequestPinCodePath));
fake_bluetooth_device_client_->CreateDevice(
dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(FakeBluetoothDeviceClient::kConfirmPasskeyPath));
FakeBluetoothDeviceClient::Properties* properties =
fake_bluetooth_device_client_->GetProperties(
dbus::ObjectPath(FakeBluetoothDeviceClient::kConfirmPasskeyPath));
properties->paired.ReplaceValue(true);
TestChromeOSMetricsProvider provider;
provider.OnDidCreateMetricsLog();
metrics::SystemProfileProto system_profile;
provider.ProvideSystemProfileMetrics(&system_profile);
ASSERT_TRUE(system_profile.has_hardware());
ASSERT_TRUE(system_profile.hardware().has_bluetooth());
// Only three of the devices should appear.
EXPECT_EQ(3, system_profile.hardware().bluetooth().paired_device_size());
typedef metrics::SystemProfileProto::Hardware::Bluetooth::PairedDevice
PairedDevice;
// As BluetoothAdapter keeps the device list without ordering,
// it's not appropriate to use fixed positional indices to index into the
// system_profile.hardware().bluetooth().paired_device list.
// Instead, directly find the two devices we're interested in.
PairedDevice device1;
PairedDevice device2;
for (int i = 0;
i < system_profile.hardware().bluetooth().paired_device_size(); ++i) {
const PairedDevice& device =
system_profile.hardware().bluetooth().paired_device(i);
if (device.bluetooth_class() ==
FakeBluetoothDeviceClient::kPairedDeviceClass &&
device.vendor_prefix() == 0x001122U) {
// Found the Paired Device object.
device1 = device;
} else if (device.bluetooth_class() ==
FakeBluetoothDeviceClient::kConfirmPasskeyClass) {
// Found the Confirm Passkey object.
device2 = device;
}
}
// The Paired Device object, complete with parsed Device ID information.
EXPECT_EQ(FakeBluetoothDeviceClient::kPairedDeviceClass,
device1.bluetooth_class());
EXPECT_EQ(PairedDevice::DEVICE_COMPUTER, device1.type());
EXPECT_EQ(0x001122U, device1.vendor_prefix());
EXPECT_EQ(PairedDevice::VENDOR_ID_USB, device1.vendor_id_source());
EXPECT_EQ(0x05ACU, device1.vendor_id());
EXPECT_EQ(0x030DU, device1.product_id());
EXPECT_EQ(0x0306U, device1.device_id());
// The Confirm Passkey object, this has no Device ID information.
EXPECT_EQ(FakeBluetoothDeviceClient::kConfirmPasskeyClass,
device2.bluetooth_class());
EXPECT_EQ(PairedDevice::DEVICE_PHONE, device2.type());
EXPECT_EQ(0x207D74U, device2.vendor_prefix());
EXPECT_EQ(PairedDevice::VENDOR_ID_UNKNOWN, device2.vendor_id_source());
}
TEST_F(ChromeOSMetricsProviderTest, NoLinkedAndroidPhone) {
fake_multidevice_setup_client_->SetHostStatusWithDevice(std::make_pair(
chromeos::multidevice_setup::mojom::HostStatus::kNoEligibleHosts,
base::nullopt /* host_device */));
TestChromeOSMetricsProvider provider;
metrics::SystemProfileProto system_profile;
provider.ProvideSystemProfileMetrics(&system_profile);
EXPECT_FALSE(system_profile.has_linked_android_phone_data());
}
TEST_F(ChromeOSMetricsProviderTest, HasLinkedAndroidPhoneAndEnabledFeatures) { TEST_F(ChromeOSMetricsProviderTest, HasLinkedAndroidPhoneAndEnabledFeatures) {
fake_multidevice_setup_client_->SetHostStatusWithDevice(std::make_pair( fake_multidevice_setup_client_->SetHostStatusWithDevice(std::make_pair(
chromeos::multidevice_setup::mojom::HostStatus::kHostVerified, chromeos::multidevice_setup::mojom::HostStatus::kHostVerified,
......
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