OSDN Git Service

Avoid IllegalArgumentException when bluetooth is disabled
authorDeqiang Chen <deqiangc@google.com>
Tue, 12 Mar 2019 21:08:12 +0000 (14:08 -0700)
committerDeqiang Chen <deqiangc@google.com>
Tue, 12 Mar 2019 21:53:45 +0000 (14:53 -0700)
commitda9f738c0cfeeebd77e7e7313a63cc1156b8ea13
tree3152bd1b0f5d933908bd49099fab7c563e3bb0dc
parent108b8d6e4053a487163cefb88d62bab781cd6827
Avoid IllegalArgumentException when bluetooth is disabled

When the corresponding profile service is not available on device,
bluetoothA2dp, bluetoothHidHost and bluetoothPbap will report
IllegalArgumentException when bluetooth is disabled. This change avoid
that exception.

Bug: 127359897
Test: local test and observe there is no IllegalArgumentException when
bluetooth is disabled

Change-Id: I457e5225b8710dd5d02c405ef558892e99d1736f
(cherry picked from commit ee8371007b82ff8c6d26e8ac90c6e3d3cf6bf2a8)
core/java/android/bluetooth/BluetoothA2dp.java
core/java/android/bluetooth/BluetoothHidHost.java
core/java/android/bluetooth/BluetoothPbap.java