Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 453534d2 authored by Hemant Gupta's avatar Hemant Gupta
Browse files

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
parent 23482a54
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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);
        }
    }