New issue
Advanced search Search tips

Issue 841261 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocking:
issue 821766



Sign in to add a comment

[bluetooth] BluetoothAdapterWinrt should get its name via its DeviceInformation

Project Member Reported by jdoerrie@chromium.org, May 9 2018

Issue description

Currently BluetoothAdapterWinrt exposes its DeviceId [1] via the GetName() method. However, this id is meant for internal use, and does not provide useful information for clients. In order to provide a real name, this DeviceId should be used to obtain the appropriate DeviceInformation [2] via CreateFromIdAsync [3], which exposes a Name [4] property as part of its interface.

In order to provide a fake implementation for tests, fake implementations of IDeviceInformationStatics and IDeviceInformation need to be introduced. Furthermore, a virtual GetDeviceInformationStaticsActivationFactory method should be added to BluetoothAdapterWinrt, which will be overidden by tests.

[1] https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.bluetoothadapter.deviceid
[2] https://docs.microsoft.com/en-us/uwp/api/windows.devices.enumeration.deviceinformation
[3] https://docs.microsoft.com/en-us/uwp/api/windows.devices.enumeration.deviceinformation.createfromidasync
[4] https://docs.microsoft.com/en-us/uwp/api/windows.devices.enumeration.deviceinformation.name
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7c0e41dc1fd29af554210a24da0b98c0938e1171

commit 7c0e41dc1fd29af554210a24da0b98c0938e1171
Author: Jan Wilken Doerrie <jdoerrie@chromium.org>
Date: Wed May 16 08:37:52 2018

[bluetooth] Retrieve WinRT Adapter Name from DeviceInformation

This change implements retrieving the BluetoothAdapter's name from its
associated DeviceInformation. Prior to this change the adapter's device
id was exposed as its name, which was not appropriate.

Bug:  841261 
Change-Id: I7a96cc4d7f70e084d99961c0e2656fc139cb0174
Reviewed-on: https://chromium-review.googlesource.com/1057569
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559014}
[modify] https://crrev.com/7c0e41dc1fd29af554210a24da0b98c0938e1171/device/BUILD.gn
[modify] https://crrev.com/7c0e41dc1fd29af554210a24da0b98c0938e1171/device/bluetooth/bluetooth_adapter_winrt.cc
[modify] https://crrev.com/7c0e41dc1fd29af554210a24da0b98c0938e1171/device/bluetooth/bluetooth_adapter_winrt.h
[modify] https://crrev.com/7c0e41dc1fd29af554210a24da0b98c0938e1171/device/bluetooth/test/bluetooth_test_win.cc
[modify] https://crrev.com/7c0e41dc1fd29af554210a24da0b98c0938e1171/device/bluetooth/test/fake_bluetooth_adapter_winrt.cc
[modify] https://crrev.com/7c0e41dc1fd29af554210a24da0b98c0938e1171/device/bluetooth/test/fake_bluetooth_adapter_winrt.h
[add] https://crrev.com/7c0e41dc1fd29af554210a24da0b98c0938e1171/device/bluetooth/test/fake_device_information_winrt.cc
[add] https://crrev.com/7c0e41dc1fd29af554210a24da0b98c0938e1171/device/bluetooth/test/fake_device_information_winrt.h

Status: Fixed (was: Started)

Sign in to add a comment