summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-28 21:48:31 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-28 21:48:31 +0000
commit68d595c6ba0e7a9cb64c0c2d9e313591c9510895 (patch)
tree6e248c46c0458965dbd1e68f6a478e06cb49b7cc
parent9467d4017392a1e39387aa479bdd23a61f3ca54f (diff)
downloadchromium_src-68d595c6ba0e7a9cb64c0c2d9e313591c9510895.zip
chromium_src-68d595c6ba0e7a9cb64c0c2d9e313591c9510895.tar.gz
chromium_src-68d595c6ba0e7a9cb64c0c2d9e313591c9510895.tar.bz2
Revert 196990 "Bluetooth: gather usage metrics"
Broke this test on the CrOs main waterfall bots: MetricsLogTest.RecordEnvironment: [19521:19521:0428/105537:1031147919:FATAL:dbus_thread_manager.cc(562)] Check failed: g_dbus_thread_manager. DBusThreadManager::Get() called before Initialize() [0x7fd74d7ce060] base::debug::StackTrace::StackTrace() [0x7fd74d8085ab] logging::LogMessage::~LogMessage() [0x7fd744a60cfe] chromeos::DBusThreadManager::Get() [0x000003d84f8f] chromeos::BluetoothAdapterChromeOS::BluetoothAdapterChromeOS() [0x000003d82c19] device::BluetoothAdapterFactory::GetAdapter() [0x0000026f1274] MetricsLog::RecordEnvironmentProto() [0x0000026f0bf2] MetricsLog::RecordEnvironment() [0x0000013ad864] MetricsLogTest::TestRecordEnvironment() [0x0000013a95d1] MetricsLogTest_RecordEnvironment_Test::TestBody() [0x000002f37967] testing::internal::HandleSehExceptionsInMethodIfSupported<>() [0x000002f35132] testing::internal::HandleExceptionsInMethodIfSupported<>() [0x000002f2a4e6] testing::Test::Run() [0x000002f2ad0a] testing::TestInfo::Run() [0x000002f2b438] testing::TestCase::Run() [0x000002f303e3] testing::internal::UnitTestImpl::RunAllTests() [0x000002f3876e] testing::internal::HandleSehExceptionsInMethodIfSupported<>() [0x000002f358f7] testing::internal::HandleExceptionsInMethodIfSupported<>() [0x000002f2eeb2] testing::UnitTest::Run() [0x0000045f17ac] base::TestSuite::Run() [0x0000042fe020] content::UnitTestTestSuite::Run() [0x00000306ea62] main [0x7fd73e27b76d] __libc_start_ > Bluetooth: gather usage metrics > > BUG=233820 > TEST=chrome:///histograms > R=isherman@chromium.org, satorux@chromium.org, youngki@chromium.org > > Review URL: https://codereview.chromium.org/13872017 TBR=keybuk@chromium.org Review URL: https://codereview.chromium.org/14001008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196993 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/metrics/metrics_log.cc97
-rw-r--r--chrome/browser/metrics/metrics_log.h15
-rw-r--r--chrome/common/metrics/proto/system_profile.proto65
-rw-r--r--chromeos/dbus/fake_bluetooth_device_client.cc2
-rw-r--r--device/bluetooth/bluetooth_adapter_experimental_chromeos.cc14
-rw-r--r--device/bluetooth/bluetooth_device.h17
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.cc12
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.h5
-rw-r--r--device/bluetooth/bluetooth_device_experimental_chromeos.cc152
-rw-r--r--device/bluetooth/bluetooth_device_experimental_chromeos.h14
-rw-r--r--device/bluetooth/bluetooth_device_mac.h5
-rw-r--r--device/bluetooth/bluetooth_device_mac.mm12
-rw-r--r--device/bluetooth/bluetooth_device_win.cc12
-rw-r--r--device/bluetooth/bluetooth_device_win.h5
-rw-r--r--device/bluetooth/bluetooth_experimental_chromeos_unittest.cc4
-rw-r--r--device/bluetooth/test/mock_bluetooth_device.h3
-rw-r--r--tools/metrics/histograms/histograms.xml44
17 files changed, 12 insertions, 466 deletions
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index 511d6d7..ec39326 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -9,7 +9,6 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/bind.h"
#include "base/file_util.h"
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
@@ -45,9 +44,6 @@
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/common/content_client.h"
#include "content/public/common/gpu_info.h"
-#include "device/bluetooth/bluetooth_adapter.h"
-#include "device/bluetooth/bluetooth_adapter_factory.h"
-#include "device/bluetooth/bluetooth_device.h"
#include "googleurl/src/gurl.h"
#include "ui/gfx/screen.h"
#include "webkit/plugins/webplugininfo.h"
@@ -73,7 +69,6 @@ using metrics::SystemProfileProto;
using tracked_objects::ProcessDataSnapshot;
typedef chrome_variations::ActiveGroupId ActiveGroupId;
typedef SystemProfileProto::GoogleUpdate::ProductInfo ProductInfo;
-typedef SystemProfileProto::Hardware::Bluetooth::PairedDevice PairedDevice;
namespace {
@@ -308,45 +303,6 @@ void WriteScreenDPIInformationProto(SystemProfileProto::Hardware* hardware) {
#endif // defined(OS_WIN)
-#if defined(OS_CHROMEOS)
-PairedDevice::Type AsBluetoothDeviceType(
- enum device::BluetoothDevice::DeviceType device_type) {
- switch (device_type) {
- case device::BluetoothDevice::DEVICE_UNKNOWN:
- return PairedDevice::DEVICE_UNKNOWN;
- case device::BluetoothDevice::DEVICE_COMPUTER:
- return PairedDevice::DEVICE_COMPUTER;
- case device::BluetoothDevice::DEVICE_PHONE:
- return PairedDevice::DEVICE_PHONE;
- case device::BluetoothDevice::DEVICE_MODEM:
- return PairedDevice::DEVICE_MODEM;
- case device::BluetoothDevice::DEVICE_AUDIO:
- return PairedDevice::DEVICE_AUDIO;
- case device::BluetoothDevice::DEVICE_CAR_AUDIO:
- return PairedDevice::DEVICE_CAR_AUDIO;
- case device::BluetoothDevice::DEVICE_VIDEO:
- return PairedDevice::DEVICE_VIDEO;
- case device::BluetoothDevice::DEVICE_PERIPHERAL:
- return PairedDevice::DEVICE_PERIPHERAL;
- case device::BluetoothDevice::DEVICE_JOYSTICK:
- return PairedDevice::DEVICE_JOYSTICK;
- case device::BluetoothDevice::DEVICE_GAMEPAD:
- return PairedDevice::DEVICE_GAMEPAD;
- case device::BluetoothDevice::DEVICE_KEYBOARD:
- return PairedDevice::DEVICE_KEYBOARD;
- case device::BluetoothDevice::DEVICE_MOUSE:
- return PairedDevice::DEVICE_MOUSE;
- case device::BluetoothDevice::DEVICE_TABLET:
- return PairedDevice::DEVICE_TABLET;
- case device::BluetoothDevice::DEVICE_KEYBOARD_MOUSE_COMBO:
- return PairedDevice::DEVICE_KEYBOARD_MOUSE_COMBO;
- }
-
- NOTREACHED();
- return PairedDevice::DEVICE_UNKNOWN;
-}
-#endif // defined(OS_CHROMEOS)
-
} // namespace
GoogleUpdateMetrics::GoogleUpdateMetrics() : is_system_install(false) {}
@@ -921,14 +877,6 @@ void MetricsLog::RecordEnvironmentProto(
PerfDataProto perf_data_proto;
if (perf_provider_.GetPerfData(&perf_data_proto))
uma_proto()->add_perf_data()->Swap(&perf_data_proto);
-
- // BluetoothAdapterFactory::GetAdapter is synchronous on Chrome OS; if that
- // changes this will fail at the DCHECK().
- device::BluetoothAdapterFactory::GetAdapter(
- base::Bind(&MetricsLog::SetBluetoothAdapter,
- base::Unretained(this)));
- DCHECK(adapter_.get());
- WriteBluetoothProto(hardware);
#endif
}
@@ -1139,48 +1087,3 @@ void MetricsLog::WriteGoogleUpdateProto(
}
#endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN)
}
-
-void MetricsLog::SetBluetoothAdapter(
- scoped_refptr<device::BluetoothAdapter> adapter) {
- adapter_ = adapter;
-}
-
-void MetricsLog::WriteBluetoothProto(
- SystemProfileProto::Hardware* hardware) {
-#if defined(OS_CHROMEOS)
- 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) {
- PairedDevice* paired_device = bluetooth->add_paired_device();
-
- device::BluetoothDevice* device = *iter;
- 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
- std::string address = device->GetAddress();
- if (address.size() > 9 &&
- address[2] == ':' && address[5] == ':' && address[8] == ':') {
- std::string vendor_prefix_str;
- uint64 vendor_prefix;
-
- 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);
- }
-
- paired_device->set_vendor_id(device->GetVendorID());
- paired_device->set_product_id(device->GetProductID());
- paired_device->set_device_id(device->GetDeviceID());
- }
-#endif // defined(OS_CHROMEOS)
-}
diff --git a/chrome/browser/metrics/metrics_log.h b/chrome/browser/metrics/metrics_log.h
index 2d102d0..f5cf34e 100644
--- a/chrome/browser/metrics/metrics_log.h
+++ b/chrome/browser/metrics/metrics_log.h
@@ -30,10 +30,6 @@ namespace base {
class DictionaryValue;
}
-namespace device {
-class BluetoothAdapter;
-}
-
namespace tracked_objects {
struct ProcessDataSnapshot;
}
@@ -193,14 +189,6 @@ class MetricsLog : public MetricsLogBase {
// This is a no-op if called on a non-Windows platform.
void WriteGoogleUpdateProto(const GoogleUpdateMetrics& google_update_metrics);
- // Sets the Bluetooth Adapter instance used for the WriteBluetoothProto()
- // call.
- void SetBluetoothAdapter(scoped_refptr<device::BluetoothAdapter> adapter);
-
- // Writes info about paired Bluetooth devices on this system.
- // This is a no-op if called on a non-Chrome OS platform.
- void WriteBluetoothProto(metrics::SystemProfileProto::Hardware* hardware);
-
// Observes network state to provide values for SystemProfile::Network.
MetricsNetworkObserver network_observer_;
@@ -208,9 +196,6 @@ class MetricsLog : public MetricsLogBase {
metrics::PerfProvider perf_provider_;
#endif
- // Bluetooth Adapter instance for collecting information about paired devices.
- scoped_refptr<device::BluetoothAdapter> adapter_;
-
DISALLOW_COPY_AND_ASSIGN(MetricsLog);
};
diff --git a/chrome/common/metrics/proto/system_profile.proto b/chrome/common/metrics/proto/system_profile.proto
index 1894578..38cbc14 100644
--- a/chrome/common/metrics/proto/system_profile.proto
+++ b/chrome/common/metrics/proto/system_profile.proto
@@ -78,7 +78,7 @@ message SystemProfileProto {
}
optional OS os = 5;
- // Next tag for Hardware: 14
+ // Next tag for Hardware: 13
// Information on the user's hardware.
message Hardware {
// The CPU architecture (x86, PowerPC, x86_64, ...)
@@ -139,71 +139,16 @@ message SystemProfileProto {
optional float overall_score = 3;
}
optional PerformanceStatistics performance_statistics = 5;
-
- // The GL_VENDOR string. An example of a gl_vendor string is
+
+ // The GL_VENDOR string. An example of a gl_vendor string is
// "Imagination Technologies". "" if we are not using OpenGL.
optional string gl_vendor = 6;
-
- // The GL_RENDERER string. An example of a gl_renderer string is
+
+ // The GL_RENDERER string. An example of a gl_renderer string is
// "PowerVR SGX 540". "" if we are not using OpenGL.
optional string gl_renderer = 7;
}
optional Graphics gpu = 8;
-
- // Information about Bluetooth devices paired with the system.
- message Bluetooth {
- // Whether Bluetooth is present on this system.
- optional bool is_present = 1;
-
- // Whether Bluetooth is enabled on this system.
- optional bool is_enabled = 2;
-
- // Describes a paired device.
- message PairedDevice {
- // Assigned class of the device. This is a bitfield according to the
- // Bluetooth specification available at the following URL:
- // https://www.bluetooth.org/en-us/specification/assigned-numbers-overview/baseband
- optional uint32 bluetooth_class = 1;
-
- // Decoded device type.
- enum Type {
- DEVICE_UNKNOWN = 0;
- DEVICE_COMPUTER = 1;
- DEVICE_PHONE = 2;
- DEVICE_MODEM = 3;
- DEVICE_AUDIO = 4;
- DEVICE_CAR_AUDIO = 5;
- DEVICE_VIDEO = 6;
- DEVICE_PERIPHERAL = 7;
- DEVICE_JOYSTICK = 8;
- DEVICE_GAMEPAD = 9;
- DEVICE_KEYBOARD = 10;
- DEVICE_MOUSE = 11;
- DEVICE_TABLET = 12;
- DEVICE_KEYBOARD_MOUSE_COMBO = 13;
- }
- optional Type type = 2;
-
- // Vendor prefix of the Bluetooth address, these are OUI registered by
- // the IEEE and are encoded with the first byte in bits 16-23, the
- // second byte in bits 8-15 and the third byte in bits 0-7.
- //
- // ie. Google's OUI (00:1A:11) is encoded as 0x00001A11
- optional uint32 vendor_prefix = 4;
-
- // Vendor ID of the device, where available.
- optional uint32 vendor_id = 5;
-
- // Product ID of the device, where available.
- optional uint32 product_id = 6;
-
- // Device ID of the device, generally the release or version number in
- // BCD format, where available.
- optional uint32 device_id = 7;
- }
- repeated PairedDevice paired_device = 3;
- }
- optional Bluetooth bluetooth = 13;
}
optional Hardware hardware = 6;
diff --git a/chromeos/dbus/fake_bluetooth_device_client.cc b/chromeos/dbus/fake_bluetooth_device_client.cc
index 73da478..f8e4702 100644
--- a/chromeos/dbus/fake_bluetooth_device_client.cc
+++ b/chromeos/dbus/fake_bluetooth_device_client.cc
@@ -161,8 +161,6 @@ FakeBluetoothDeviceClient::FakeBluetoothDeviceClient()
uuids.push_back("00001801-0000-1000-8000-00805f9b34fb");
properties->uuids.ReplaceValue(uuids);
- properties->modalias.ReplaceValue("usb:v05ACp030Dd0306");
-
properties_map_[dbus::ObjectPath(kPairedDevicePath)] = properties;
device_list_.push_back(dbus::ObjectPath(kPairedDevicePath));
}
diff --git a/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc b/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
index 6a282f3..5051690 100644
--- a/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
+++ b/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
@@ -8,7 +8,6 @@
#include "base/bind.h"
#include "base/logging.h"
-#include "base/metrics/histogram.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/experimental_bluetooth_adapter_client.h"
#include "chromeos/dbus/experimental_bluetooth_device_client.h"
@@ -254,19 +253,6 @@ void BluetoothAdapterExperimentalChromeOS::DevicePropertyChanged(
property_name == properties->connected.name() ||
property_name == properties->uuids.name())
NotifyDeviceChanged(device_chromeos);
-
- // UMA connection counting
- if (property_name == properties->connected.name()) {
- int count = 0;
-
- for (DevicesMap::iterator iter = devices_.begin();
- iter != devices_.end(); ++iter) {
- if (iter->second->IsConnected())
- ++count;
- }
-
- UMA_HISTOGRAM_COUNTS_100("Bluetooth.ConnectedDeviceCount", count);
- }
}
void BluetoothAdapterExperimentalChromeOS::InputPropertyChanged(
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index e442080..c48fff7 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -167,24 +167,10 @@ class BluetoothDevice {
virtual ~BluetoothDevice();
- // Returns the Bluetooth class of the device, used by GetDeviceType()
- // and metrics logging,
- virtual uint32 GetBluetoothClass() const = 0;
-
// Returns the Bluetooth of address the device. This should be used as
// a unique key to identify the device and copied where needed.
virtual std::string GetAddress() const = 0;
- // Returns the Vendor ID of the device, where available.
- virtual uint16 GetVendorID() const = 0;
-
- // Returns the Product ID of the device, where available.
- virtual uint16 GetProductID() const = 0;
-
- // Returns the Device ID of the device, typically the release or version
- // number in BCD format, where available.
- virtual uint16 GetDeviceID() const = 0;
-
// Returns the name of the device suitable for displaying, this may
// be a synthesied string containing the address and localized type name
// if the device has no obtained name.
@@ -358,6 +344,9 @@ class BluetoothDevice {
protected:
BluetoothDevice();
+ // Returns the Bluetooth class of the device, used by GetDeviceType().
+ virtual uint32 GetBluetoothClass() const = 0;
+
// Returns the internal name of the Bluetooth device, used by GetName().
virtual std::string GetDeviceName() const = 0;
diff --git a/device/bluetooth/bluetooth_device_chromeos.cc b/device/bluetooth/bluetooth_device_chromeos.cc
index 4f3b5ae..9d18de0 100644
--- a/device/bluetooth/bluetooth_device_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_chromeos.cc
@@ -78,18 +78,6 @@ std::string BluetoothDeviceChromeOS::GetAddress() const {
return address_;
}
-uint16 BluetoothDeviceChromeOS::GetVendorID() const {
- return 0;
-}
-
-uint16 BluetoothDeviceChromeOS::GetProductID() const {
- return 0;
-}
-
-uint16 BluetoothDeviceChromeOS::GetDeviceID() const {
- return 0;
-}
-
bool BluetoothDeviceChromeOS::IsPaired() const {
return paired_ || trusted_;
}
diff --git a/device/bluetooth/bluetooth_device_chromeos.h b/device/bluetooth/bluetooth_device_chromeos.h
index 72718b2..baa1f6e 100644
--- a/device/bluetooth/bluetooth_device_chromeos.h
+++ b/device/bluetooth/bluetooth_device_chromeos.h
@@ -40,11 +40,7 @@ class BluetoothDeviceChromeOS
virtual ~BluetoothDeviceChromeOS();
// BluetoothDevice override
- virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetAddress() const OVERRIDE;
- virtual uint16 GetVendorID() const OVERRIDE;
- virtual uint16 GetProductID() const OVERRIDE;
- virtual uint16 GetDeviceID() const OVERRIDE;
virtual bool IsPaired() const OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectable() const OVERRIDE;
@@ -89,6 +85,7 @@ class BluetoothDeviceChromeOS
protected:
// BluetoothDevice override
+ virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetDeviceName() const OVERRIDE;
private:
diff --git a/device/bluetooth/bluetooth_device_experimental_chromeos.cc b/device/bluetooth/bluetooth_device_experimental_chromeos.cc
index 3e11439..09c1ddf 100644
--- a/device/bluetooth/bluetooth_device_experimental_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_experimental_chromeos.cc
@@ -5,9 +5,6 @@
#include "device/bluetooth/bluetooth_device_experimental_chromeos.h"
#include "base/bind.h"
-#include "base/metrics/histogram.h"
-#include "base/string_util.h"
-#include "base/strings/string_number_conversions.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/experimental_bluetooth_adapter_client.h"
#include "chromeos/dbus/experimental_bluetooth_agent_manager_client.h"
@@ -28,67 +25,6 @@ namespace {
// (which we fail in OnRegisterAgentError with ERROR_INPROGRESS).
const char kAgentPath[] = "/org/chromium/bluetooth_agent";
-// Histogram enumerations for pairing methods.
-enum UMAPairingMethod {
- UMA_PAIRING_METHOD_NONE,
- UMA_PAIRING_METHOD_REQUEST_PINCODE,
- UMA_PAIRING_METHOD_REQUEST_PASSKEY,
- UMA_PAIRING_METHOD_DISPLAY_PINCODE,
- UMA_PAIRING_METHOD_DISPLAY_PASSKEY,
- UMA_PAIRING_METHOD_CONFIRM_PASSKEY,
- // NOTE: Add new pairing methods immediately above this line. Make sure to
- // update the enum list in tools/histogram/histograms.xml accordinly.
- UMA_PAIRING_METHOD_COUNT
-};
-
-// Histogram enumerations for pairing results.
-enum UMAPairingResult {
- UMA_PAIRING_RESULT_SUCCESS,
- UMA_PAIRING_RESULT_INPROGRESS,
- UMA_PAIRING_RESULT_FAILED,
- UMA_PAIRING_RESULT_AUTH_FAILED,
- UMA_PAIRING_RESULT_AUTH_CANCELED,
- UMA_PAIRING_RESULT_AUTH_REJECTED,
- UMA_PAIRING_RESULT_AUTH_TIMEOUT,
- UMA_PAIRING_RESULT_UNSUPPORTED_DEVICE,
- UMA_PAIRING_RESULT_UNKNOWN_ERROR,
- // NOTE: Add new pairing results immediately above this line. Make sure to
- // update the enum list in tools/histogram/histograms.xml accordinly.
- UMA_PAIRING_RESULT_COUNT
-};
-
-void ParseModalias(const dbus::ObjectPath& object_path,
- uint16 *vendor_id,
- uint16 *product_id,
- uint16 *device_id) {
- chromeos::ExperimentalBluetoothDeviceClient::Properties* properties =
- chromeos::DBusThreadManager::Get()->
- GetExperimentalBluetoothDeviceClient()->GetProperties(object_path);
- DCHECK(properties);
-
- std::string modalias = properties->modalias.value();
- if (StartsWithASCII(modalias, "usb:", false) && modalias.length() == 19) {
- // usb:vXXXXpXXXXdXXXX
- if (modalias[4] == 'v' && vendor_id != NULL) {
- uint64 component = 0;
- base::HexStringToUInt64(modalias.substr(5, 4), &component);
- *vendor_id = component;
- }
-
- if (modalias[9] == 'p' && product_id != NULL) {
- uint64 component = 0;
- base::HexStringToUInt64(modalias.substr(10, 4), &component);
- *product_id = component;
- }
-
- if (modalias[14] == 'd' && device_id != NULL) {
- uint64 component = 0;
- base::HexStringToUInt64(modalias.substr(15, 4), &component);
- *device_id = component;
- }
- }
-}
-
} // namespace
namespace chromeos {
@@ -100,7 +36,6 @@ BluetoothDeviceExperimentalChromeOS::BluetoothDeviceExperimentalChromeOS(
object_path_(object_path),
num_connecting_calls_(0),
pairing_delegate_(NULL),
- pairing_delegate_used_(false),
weak_ptr_factory_(this) {
}
@@ -134,24 +69,6 @@ std::string BluetoothDeviceExperimentalChromeOS::GetAddress() const {
return properties->address.value();
}
-uint16 BluetoothDeviceExperimentalChromeOS::GetVendorID() const {
- uint16 vendor_id = 0;
- ParseModalias(object_path_, &vendor_id, NULL, NULL);
- return vendor_id;
-}
-
-uint16 BluetoothDeviceExperimentalChromeOS::GetProductID() const {
- uint16 product_id = 0;
- ParseModalias(object_path_, NULL, &product_id, NULL);
- return product_id;
-}
-
-uint16 BluetoothDeviceExperimentalChromeOS::GetDeviceID() const {
- uint16 device_id = 0;
- ParseModalias(object_path_, NULL, NULL, &device_id);
- return device_id;
-}
-
bool BluetoothDeviceExperimentalChromeOS::IsPaired() const {
ExperimentalBluetoothDeviceClient::Properties* properties =
DBusThreadManager::Get()->GetExperimentalBluetoothDeviceClient()->
@@ -244,7 +161,6 @@ void BluetoothDeviceExperimentalChromeOS::Connect(
DCHECK(agent_.get() == NULL);
pairing_delegate_ = pairing_delegate;
- pairing_delegate_used_ = false;
// The agent path is relatively meaningless since BlueZ only supports
// one per application at a time.
@@ -394,10 +310,6 @@ void BluetoothDeviceExperimentalChromeOS::RequestPinCode(
DCHECK(device_path == object_path_);
VLOG(1) << object_path_.value() << ": RequestPinCode";
- UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
- UMA_PAIRING_METHOD_REQUEST_PINCODE,
- UMA_PAIRING_METHOD_COUNT);
-
DCHECK(pairing_delegate_);
DCHECK(pincode_callback_.is_null());
pincode_callback_ = callback;
@@ -411,10 +323,6 @@ void BluetoothDeviceExperimentalChromeOS::DisplayPinCode(
DCHECK(device_path == object_path_);
VLOG(1) << object_path_.value() << ": DisplayPinCode: " << pincode;
- UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
- UMA_PAIRING_METHOD_DISPLAY_PINCODE,
- UMA_PAIRING_METHOD_COUNT);
-
DCHECK(pairing_delegate_);
pairing_delegate_->DisplayPinCode(this, pincode);
}
@@ -426,10 +334,6 @@ void BluetoothDeviceExperimentalChromeOS::RequestPasskey(
DCHECK(device_path == object_path_);
VLOG(1) << object_path_.value() << ": RequestPasskey";
- UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
- UMA_PAIRING_METHOD_REQUEST_PASSKEY,
- UMA_PAIRING_METHOD_COUNT);
-
DCHECK(pairing_delegate_);
DCHECK(passkey_callback_.is_null());
passkey_callback_ = callback;
@@ -445,11 +349,6 @@ void BluetoothDeviceExperimentalChromeOS::DisplayPasskey(
VLOG(1) << object_path_.value() << ": DisplayPasskey: " << passkey
<< " (" << entered << " entered)";
- if (entered == 0)
- UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
- UMA_PAIRING_METHOD_DISPLAY_PASSKEY,
- UMA_PAIRING_METHOD_COUNT);
-
DCHECK(pairing_delegate_);
if (entered == 0)
pairing_delegate_->DisplayPasskey(this, passkey);
@@ -464,10 +363,6 @@ void BluetoothDeviceExperimentalChromeOS::RequestConfirmation(
DCHECK(device_path == object_path_);
VLOG(1) << object_path_.value() << ": RequestConfirmation: " << passkey;
- UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
- UMA_PAIRING_METHOD_CONFIRM_PASSKEY,
- UMA_PAIRING_METHOD_COUNT);
-
DCHECK(pairing_delegate_);
DCHECK(confirmation_callback_.is_null());
confirmation_callback_ = callback;
@@ -551,7 +446,6 @@ void BluetoothDeviceExperimentalChromeOS::OnConnectError(
error_code = ERROR_UNSUPPORTED_DEVICE;
}
- RecordPairingResult(false, error_code);
error_callback.Run(error_code);
}
@@ -592,7 +486,6 @@ void BluetoothDeviceExperimentalChromeOS::OnRegisterAgentError(
if (error_name == bluetooth_adapter::kErrorAlreadyExists)
error_code = ERROR_INPROGRESS;
- RecordPairingResult(false, error_code);
error_callback.Run(error_code);
}
@@ -600,11 +493,6 @@ void BluetoothDeviceExperimentalChromeOS::OnPair(
const base::Closure& callback,
const ConnectErrorCallback& error_callback) {
VLOG(1) << object_path_.value() << ": Paired";
-
- if (!pairing_delegate_used_)
- UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
- UMA_PAIRING_METHOD_NONE,
- UMA_PAIRING_METHOD_COUNT);
UnregisterAgent();
SetTrusted();
ConnectInternal(callback, error_callback);
@@ -639,7 +527,6 @@ void BluetoothDeviceExperimentalChromeOS::OnPairError(
error_code = ERROR_AUTH_TIMEOUT;
}
- RecordPairingResult(false, error_code);
error_callback.Run(error_code);
}
@@ -749,43 +636,4 @@ bool BluetoothDeviceExperimentalChromeOS::RunPairingCallbacks(Status status) {
return callback_run;
}
-void BluetoothDeviceExperimentalChromeOS::RecordPairingResult(
- bool success,
- ConnectErrorCode error_code) {
- UMAPairingResult pairing_result;
- if (success) {
- pairing_result = UMA_PAIRING_RESULT_SUCCESS;
- } else {
- switch (error_code) {
- case ERROR_INPROGRESS:
- pairing_result = UMA_PAIRING_RESULT_INPROGRESS;
- break;
- case ERROR_FAILED:
- pairing_result = UMA_PAIRING_RESULT_FAILED;
- break;
- case ERROR_AUTH_FAILED:
- pairing_result = UMA_PAIRING_RESULT_AUTH_FAILED;
- break;
- case ERROR_AUTH_CANCELED:
- pairing_result = UMA_PAIRING_RESULT_AUTH_CANCELED;
- break;
- case ERROR_AUTH_REJECTED:
- pairing_result = UMA_PAIRING_RESULT_AUTH_REJECTED;
- break;
- case ERROR_AUTH_TIMEOUT:
- pairing_result = UMA_PAIRING_RESULT_AUTH_TIMEOUT;
- break;
- case ERROR_UNSUPPORTED_DEVICE:
- pairing_result = UMA_PAIRING_RESULT_UNSUPPORTED_DEVICE;
- break;
- default:
- pairing_result = UMA_PAIRING_RESULT_UNKNOWN_ERROR;
- }
- }
-
- UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingResult",
- pairing_result,
- UMA_PAIRING_RESULT_COUNT);
-}
-
} // namespace chromeos
diff --git a/device/bluetooth/bluetooth_device_experimental_chromeos.h b/device/bluetooth/bluetooth_device_experimental_chromeos.h
index 0a19d26..a260bec 100644
--- a/device/bluetooth/bluetooth_device_experimental_chromeos.h
+++ b/device/bluetooth/bluetooth_device_experimental_chromeos.h
@@ -27,11 +27,7 @@ class BluetoothDeviceExperimentalChromeOS
private chromeos::ExperimentalBluetoothAgentServiceProvider::Delegate {
public:
// BluetoothDevice override
- virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetAddress() const OVERRIDE;
- virtual uint16 GetVendorID() const OVERRIDE;
- virtual uint16 GetProductID() const OVERRIDE;
- virtual uint16 GetDeviceID() const OVERRIDE;
virtual bool IsPaired() const OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectable() const OVERRIDE;
@@ -76,6 +72,7 @@ class BluetoothDeviceExperimentalChromeOS
protected:
// BluetoothDevice override
+ virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetDeviceName() const OVERRIDE;
private:
@@ -170,11 +167,6 @@ class BluetoothDeviceExperimentalChromeOS
// pairing. Returns true if any callbacks were run, false if not.
bool RunPairingCallbacks(Status status);
- // Record the result of pairing as a UMA histogram metric; |success| should
- // be true if pairing succeeded, and |false| if not - in which case
- // |error_code| specifies the reason for failure.
- void RecordPairingResult(bool success, ConnectErrorCode error_code);
-
// Return the object path of the device; used by
// BluetoothAdapterExperimentalChromeOS
const dbus::ObjectPath& object_path() const { return object_path_; }
@@ -193,10 +185,6 @@ class BluetoothDeviceExperimentalChromeOS
// Passkeys. Generally it is the object that owns this one.
PairingDelegate* pairing_delegate_;
- // Flag to indicate whether a pairing delegate method has been called during
- // pairing.
- bool pairing_delegate_used_;
-
// During pairing this is set to an instance of a D-Bus agent object
// intialized with our own class as its delegate.
scoped_ptr<ExperimentalBluetoothAgentServiceProvider> agent_;
diff --git a/device/bluetooth/bluetooth_device_mac.h b/device/bluetooth/bluetooth_device_mac.h
index d3beb0f..81ae518 100644
--- a/device/bluetooth/bluetooth_device_mac.h
+++ b/device/bluetooth/bluetooth_device_mac.h
@@ -24,11 +24,7 @@ class BluetoothDeviceMac : public BluetoothDevice {
virtual ~BluetoothDeviceMac();
// BluetoothDevice override
- virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetAddress() const OVERRIDE;
- virtual uint16 GetVendorID() const OVERRIDE;
- virtual uint16 GetProductID() const OVERRIDE;
- virtual uint16 GetDeviceID() const OVERRIDE;
virtual bool IsPaired() const OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectable() const OVERRIDE;
@@ -73,6 +69,7 @@ class BluetoothDeviceMac : public BluetoothDevice {
protected:
// BluetoothDevice override
+ virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetDeviceName() const OVERRIDE;
private:
diff --git a/device/bluetooth/bluetooth_device_mac.mm b/device/bluetooth/bluetooth_device_mac.mm
index ef54af1..2042eaf 100644
--- a/device/bluetooth/bluetooth_device_mac.mm
+++ b/device/bluetooth/bluetooth_device_mac.mm
@@ -82,18 +82,6 @@ std::string BluetoothDeviceMac::GetAddress() const {
return base::SysNSStringToUTF8([device_ addressString]);
}
-uint16 BluetoothDeviceMac::GetVendorID() const {
- return 0;
-}
-
-uint16 BluetoothDeviceMac::GetProductID() const {
- return 0;
-}
-
-uint16 BluetoothDeviceMac::GetDeviceID() const {
- return 0;
-}
-
bool BluetoothDeviceMac::IsPaired() const {
return [device_ isPaired];
}
diff --git a/device/bluetooth/bluetooth_device_win.cc b/device/bluetooth/bluetooth_device_win.cc
index 7779166..cfe9ac9 100644
--- a/device/bluetooth/bluetooth_device_win.cc
+++ b/device/bluetooth/bluetooth_device_win.cc
@@ -71,18 +71,6 @@ std::string BluetoothDeviceWin::GetAddress() const {
return address_;
}
-uint16 BluetoothDeviceWin::GetVendorID() const {
- return 0;
-}
-
-uint16 BluetoothDeviceWin::GetProductID() const {
- return 0;
-}
-
-uint16 BluetoothDeviceWin::GetDeviceID() const {
- return 0;
-}
-
bool BluetoothDeviceWin::IsPaired() const {
return paired_;
}
diff --git a/device/bluetooth/bluetooth_device_win.h b/device/bluetooth/bluetooth_device_win.h
index 6bfdf92..be0e257 100644
--- a/device/bluetooth/bluetooth_device_win.h
+++ b/device/bluetooth/bluetooth_device_win.h
@@ -23,11 +23,7 @@ class BluetoothDeviceWin : public BluetoothDevice {
virtual ~BluetoothDeviceWin();
// BluetoothDevice override
- virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetAddress() const OVERRIDE;
- virtual uint16 GetVendorID() const OVERRIDE;
- virtual uint16 GetProductID() const OVERRIDE;
- virtual uint16 GetDeviceID() const OVERRIDE;
virtual bool IsPaired() const OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectable() const OVERRIDE;
@@ -72,6 +68,7 @@ class BluetoothDeviceWin : public BluetoothDevice {
protected:
// BluetoothDevice override
+ virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetDeviceName() const OVERRIDE;
private:
diff --git a/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc b/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
index d868a5b..9d668f4 100644
--- a/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
@@ -764,10 +764,6 @@ TEST_F(BluetoothExperimentalChromeOSTest, DeviceProperties) {
ASSERT_EQ(2U, uuids.size());
EXPECT_EQ(uuids[0], "00001800-0000-1000-8000-00805f9b34fb");
EXPECT_EQ(uuids[1], "00001801-0000-1000-8000-00805f9b34fb");
-
- EXPECT_EQ(0x05ac, devices[0]->GetVendorID());
- EXPECT_EQ(0x030d, devices[0]->GetProductID());
- EXPECT_EQ(0x0306, devices[0]->GetDeviceID());
}
TEST_F(BluetoothExperimentalChromeOSTest, DeviceClassChanged) {
diff --git a/device/bluetooth/test/mock_bluetooth_device.h b/device/bluetooth/test/mock_bluetooth_device.h
index d61f6ff..b2b93d5 100644
--- a/device/bluetooth/test/mock_bluetooth_device.h
+++ b/device/bluetooth/test/mock_bluetooth_device.h
@@ -29,9 +29,6 @@ class MockBluetoothDevice : public BluetoothDevice {
MOCK_CONST_METHOD0(GetBluetoothClass, uint32());
MOCK_CONST_METHOD0(GetDeviceName, std::string());
MOCK_CONST_METHOD0(GetAddress, std::string());
- MOCK_CONST_METHOD0(GetVendorID, uint16());
- MOCK_CONST_METHOD0(GetProductID, uint16());
- MOCK_CONST_METHOD0(GetDeviceID, uint16());
MOCK_CONST_METHOD0(GetName, string16());
MOCK_CONST_METHOD0(GetDeviceType, BluetoothDevice::DeviceType());
MOCK_CONST_METHOD0(IsPaired, bool());
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index d0ed103..4252654 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -371,29 +371,6 @@ other types of suffix sets.
</summary>
</histogram>
-<histogram name="Bluetooth.ConnectedDeviceCount" units="devices">
- <summary>
- Counts the number of simulataneously connected Bluetooth devices. Used to
- direct testing efforts, and by our UI team to determine appropriate UI
- sizes.
- </summary>
-</histogram>
-
-<histogram name="Bluetooth.PairingMethod" enum="BluetoothPairingMethod">
- <summary>
- Records the method used to pair each Bluetooth Device. Used to direct our
- testing efforts.
- </summary>
-</histogram>
-
-<histogram name="Bluetooth.PairingResult" enum="BluetoothPairingResult">
- <summary>
- Records the result of pairing each Bluetooth Device. Used to understand
- whether we are having significant problems with Bluetooth pairing and seeing
- errors more commonly than we should.
- </summary>
-</histogram>
-
<histogram name="Cellular.ActivationFailure">
<summary>
The count of cellular device activation failures (Chrome OS).
@@ -6334,27 +6311,6 @@ other types of suffix sets.
<int value="2" label="Failure"/>
</enum>
-<enum name="BluetoothPairingMethod" type="int">
- <int value="0" label="No user interaction required"/>
- <int value="1" label="PIN Code requested from user"/>
- <int value="2" label="Passkey requested from user"/>
- <int value="3" label="PIN Code entered into device"/>
- <int value="4" label="Passkey entered into device"/>
- <int value="5" label="Passkey confirmed on both devices"/>
-</enum>
-
-<enum name="BluetoothPairingResult" type="int">
- <int value="0" label="Success"/>
- <int value="1" label="Connection already in-progress"/>
- <int value="2" label="Failed for non-specific reason"/>
- <int value="3" label="Authentication failed"/>
- <int value="4" label="Authentication canceled"/>
- <int value="5" label="Authentication rejected"/>
- <int value="6" label="Authentication timed out"/>
- <int value="7" label="Unsupported device"/>
- <int value="8" label="Unknown or unhandler error"/>
-</enum>
-
<enum name="BooleanAttempted" type="int">
<int value="0" label="Not Attempted"/>
<int value="1" label="Attempted"/>