From 453534d2101a65fc1bda393faff911fa717a58d8 Mon Sep 17 00:00:00 2001 From: Hemant Gupta Date: Tue, 19 Jun 2018 15:01:47 +0530 Subject: [PATCH] Bluetooth: PBAP not disconnected on disabling contact sharing Precondition: Contact Sharing is checked and there is PBAP Connection. Usecase: 1) Establish PBAP Connection. 2) Disable "Contact Sharing" button. 3) Check if PBAP is Disconnected or not. Issue: PBAP Profile Disconnection is not triggered. Root Cause: Change in Setting menu UI by removal of "Disable Profile" dialog box (like Android O) has resulted in not invoking PBAP Disconnect call from Setting App. Fix: Handle Disconnection for PBAP from API disableProfile() at settings/bluetooth/BluetoothDetailsProfilesController.java like other profiles. Test: Issue is not seen as per above usecase. Bug: 110515410 Change-Id: Ibd18fb836e10e79e99e6b04127ae181134201cef --- .../bluetooth/BluetoothDetailsProfilesController.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java index b0ed05681d6..ddb61790f21 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java @@ -148,15 +148,12 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll */ private void disableProfile(LocalBluetoothProfile profile, BluetoothDevice device, SwitchPreference profilePref) { - if (profile instanceof PbapServerProfile) { - mCachedDevice.setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_REJECTED); - // We don't need to do the additional steps below for this profile. - return; - } mCachedDevice.disconnect(profile); profile.setPreferred(device, false); if (profile instanceof MapProfile) { mCachedDevice.setMessagePermissionChoice(BluetoothDevice.ACCESS_REJECTED); + } else if (profile instanceof PbapServerProfile) { + mCachedDevice.setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_REJECTED); } }