Commit 6dd29a4b authored by Donna Wu's avatar Donna Wu Committed by Commit Bot

Fix a bug for UsbChooserContext::GetDevices().

Whe GetDevices() is the first method call to be made, we should also
need to make sure the connection with the DeviceService.

Bug: 699790
Change-Id: Ie5d6b8f606fafba7372bffcfffc4d3e13e2f3603
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617201
Commit-Queue: Donna Wu <donna.wu@intel.com>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662037}
parent 9da99755
......@@ -465,6 +465,7 @@ bool UsbChooserContext::HasDevicePermission(
void UsbChooserContext::GetDevices(
device::mojom::UsbDeviceManager::GetDevicesCallback callback) {
if (!is_initialized_) {
EnsureConnectionWithDeviceManager();
pending_get_devices_requests_.push(std::move(callback));
return;
}
......
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