PBAP: Allow wearable handsfree device for PBAP Access

Allow wearable handsfree device for PBAP Access

Usecase:
1) Pair and connect with Jabra Stealth Headset.
2) Go out of range so that connection gets disconnected
3) Come back in range, so that reconnection happens.

Observation:
Headset fails to reconnect with DUT in some scenarios.

Root Cause:
Headset does not send page request to DUT in some scenarios
leading to reconnection issues. This propabaly happens because
Headset fails to connect PBAP in previous iteration so it goes
in bad state, and does not page after Link Supervision Timeout.

Current Settings code only allows Audio_video_Handsfree Class of
devices to have PBAP Access permission, and set Rejected Permission
for other Audio Device Class. This headset being Wearable Class (0x0404)
is set as PBAP Rejected, and all PBAP connection to DUT from this remote
device are rejected leading to issue of bad state in headset.

Fix:
Allow wearable class audio devices to also have PBAP access permission.

Bug: 29219133
Change-Id: I18d8412cbeb86c18610091898d1c79f26d3d808d
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index c075703..a879d16f 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -809,7 +809,9 @@
             // No separate prompt is displayed after pairing.
             if (getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_UNKNOWN) {
                 if (mDevice.getBluetoothClass().getDeviceClass()
-                        == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) {
+                        == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE ||
+                    mDevice.getBluetoothClass().getDeviceClass()
+                        == BluetoothClass.Device.AUDIO_VIDEO_WEARABLE_HEADSET) {
                     setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
                 } else {
                     setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_REJECTED);