OSDN Git Service

Audio: Check if BluetoothDevice.getName() returns null
authorJack He <siyuanh@google.com>
Wed, 3 Apr 2019 07:48:49 +0000 (00:48 -0700)
committerJack He <siyuanh@google.com>
Wed, 3 Apr 2019 20:39:26 +0000 (13:39 -0700)
commitcb49964b533c05fa0106d6090644e6b3dd741273
tree31ecb5f24143b8eb3df78231767e856594d47672
parent79d943d4476694c506433d39112a271b7f8a1fcb
Audio: Check if BluetoothDevice.getName() returns null

* BluetoothDevice.getName() could return null if Bluetooth process
  is not running. This patch uses empty string "" to replace the null
  value returned from BluetoothDevice.getName(). The logic is wrapped
  in BtHelper#getName(BluetoothDevice) method

Fixes: 129806133
Test: atest BluetoothInstrumentationTests on eng build
Change-Id: If44e675aafa779fa86451742aa917404987fc15a
services/core/java/com/android/server/audio/AudioDeviceInventory.java
services/core/java/com/android/server/audio/BtHelper.java