Bluetooth: Only show devices when their names are resolved

* Add a developer menu option to allow name-less devices to be shown
  when a Bluetooth developer needs it, but hide it for non-developer
  users.
* Set BluetoothDevicePreference to invisible when CachedBluetoothDevice
  does not have a name besides MAC address and the above developer option
  is false.
* This affects BluetoothPairingDetail and DevicePickerFragment, but does
  not affect BluetoothSettings. BluetoothSettings will show all paired
  devices regardless whether an user friendly name exists.

Bug: 34685932
Test: pair Bluetooth device, send file over Bluetooth, unit tests
Change-Id: Idd7ad4b1671dfdcf3204efb50eddb6dae1065aa5
This commit is contained in:
Jack He
2017-05-31 18:37:28 -07:00
parent 77bd8c3a73
commit 19ba320263
6 changed files with 102 additions and 5 deletions

View File

@@ -140,6 +140,8 @@ public class BluetoothSettings extends DeviceListPreferenceFragment implements I
mBluetoothEnabler.resume(getActivity());
}
super.onStart();
// Always show paired devices regardless whether user-friendly name exists
mShowDevicesWithoutNames = true;
if (isUiRestricted()) {
getPreferenceScreen().removeAll();
if (!isUiRestrictedByOnlyAdmin()) {