summaryrefslogtreecommitdiff
path: root/chromium/device
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/device')
-rw-r--r--chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc3
-rw-r--r--chromium/device/bluetooth/strings/bluetooth_strings_fa.xtb2
-rw-r--r--chromium/device/gamepad/BUILD.gn2
-rw-r--r--chromium/device/usb/usb_service_linux.cc33
4 files changed, 25 insertions, 15 deletions
diff --git a/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc b/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc
index 2dcc3a33005..adcca0b7063 100644
--- a/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc
+++ b/chromium/device/bluetooth/dbus/fake_bluetooth_device_client.cc
@@ -655,6 +655,8 @@ void FakeBluetoothDeviceClient::CreateDevice(
new Properties(base::Bind(&FakeBluetoothDeviceClient::OnPropertyChanged,
base::Unretained(this), device_path)));
properties->adapter.ReplaceValue(adapter_path);
+ properties->type.ReplaceValue(BluetoothDeviceClient::kTypeBredr);
+ properties->type.set_valid(true);
if (device_path == dbus::ObjectPath(kLegacyAutopairPath)) {
properties->address.ReplaceValue(kLegacyAutopairAddress);
@@ -743,6 +745,7 @@ void FakeBluetoothDeviceClient::CreateDevice(
properties->bluetooth_class.ReplaceValue(kLowEnergyClass);
properties->name.ReplaceValue("Heart Rate Monitor");
properties->alias.ReplaceValue(kLowEnergyName);
+ properties->type.ReplaceValue(BluetoothDeviceClient::kTypeLe);
std::vector<std::string> uuids;
uuids.push_back(FakeBluetoothGattServiceClient::kHeartRateServiceUUID);
diff --git a/chromium/device/bluetooth/strings/bluetooth_strings_fa.xtb b/chromium/device/bluetooth/strings/bluetooth_strings_fa.xtb
index aa45f995b80..1fefe3996ca 100644
--- a/chromium/device/bluetooth/strings/bluetooth_strings_fa.xtb
+++ b/chromium/device/bluetooth/strings/bluetooth_strings_fa.xtb
@@ -7,7 +7,7 @@
<translation id="4287283380557401002">صوتی خودرو (<ph name="ADDRESS" />)</translation>
<translation id="430326050669417502">دسته کنترل (<ph name="ADDRESS" />)</translation>
<translation id="5271696982761495740">رایانهٔ لوحی (<ph name="ADDRESS" />)</translation>
-<translation id="5376363957846771741">دستگاه ناشناخته یا پشتیبانی نشده (<ph name="ADDRESS" />)</translation>
+<translation id="5376363957846771741">دستگاه ناشناس یا پشتیبانی نشده (<ph name="ADDRESS" />)</translation>
<translation id="654594702871184195">صوتی (<ph name="ADDRESS" />)</translation>
<translation id="6744468237221042970">رایانه (<ph name="ADDRESS" />)</translation>
<translation id="7501330106833014351">پد بازی (<ph name="ADDRESS" />)</translation>
diff --git a/chromium/device/gamepad/BUILD.gn b/chromium/device/gamepad/BUILD.gn
index 7c0d6695acf..f262b866cd2 100644
--- a/chromium/device/gamepad/BUILD.gn
+++ b/chromium/device/gamepad/BUILD.gn
@@ -13,6 +13,8 @@ component("gamepad") {
output_name = "device_gamepad"
sources = [
+ "android/gamepad_jni_registrar.cc",
+ "android/gamepad_jni_registrar.h",
"gamepad_consumer.cc",
"gamepad_consumer.h",
"gamepad_data_fetcher.cc",
diff --git a/chromium/device/usb/usb_service_linux.cc b/chromium/device/usb/usb_service_linux.cc
index 2afc459a308..c61f09715f7 100644
--- a/chromium/device/usb/usb_service_linux.cc
+++ b/chromium/device/usb/usb_service_linux.cc
@@ -217,6 +217,11 @@ void UsbServiceLinux::OnDeviceAdded(const std::string& device_path,
uint8_t active_configuration) {
DCHECK(CalledOnValidThread());
+ if (ContainsKey(devices_by_path_, device_path)) {
+ USB_LOG(ERROR) << "Got duplicate add event for path: " << device_path;
+ return;
+ }
+
// Devices that appear during initial enumeration are gathered into the first
// result returned by GetDevices() and prevent device add/remove notifications
// from being sent.
@@ -250,20 +255,20 @@ void UsbServiceLinux::DeviceReady(scoped_refptr<UsbDeviceLinux> device,
// If |device| was disconnected while descriptors were being read then it
// will have been removed from |devices_by_path_|.
auto it = devices_by_path_.find(device->device_path());
- if (it != devices_by_path_.end()) {
- if (success) {
- DCHECK(!ContainsKey(devices(), device->guid()));
- devices()[device->guid()] = device;
-
- USB_LOG(USER) << "USB device added: path=" << device->device_path()
- << " vendor=" << device->vendor_id() << " \""
- << device->manufacturer_string()
- << "\", product=" << device->product_id() << " \""
- << device->product_string() << "\", serial=\""
- << device->serial_number() << "\", guid=" << device->guid();
- } else {
- devices_by_path_.erase(it);
- }
+ if (it == devices_by_path_.end()) {
+ success = false;
+ } else if (success) {
+ DCHECK(!ContainsKey(devices(), device->guid()));
+ devices()[device->guid()] = device;
+
+ USB_LOG(USER) << "USB device added: path=" << device->device_path()
+ << " vendor=" << device->vendor_id() << " \""
+ << device->manufacturer_string()
+ << "\", product=" << device->product_id() << " \""
+ << device->product_string() << "\", serial=\""
+ << device->serial_number() << "\", guid=" << device->guid();
+ } else {
+ devices_by_path_.erase(it);
}
if (enumeration_became_ready) {