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

Commit ccd95ee3 authored by Gaurav Asati's avatar Gaurav Asati
Browse files

Bluetooth:Send Connection request after Connection Failure.

When one of profile is un-checked from setting sub-menu and initial
connection has failed then try to re-connect selected profile.

Change-Id: I67bf658b5b9ce556fc0d54030989e6033651051b
CRs-Fixed: 543050
parent 6688afea
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1187,13 +1187,18 @@ public class AdapterService extends Service {
                }
            }
        }
       // This change makes sure that we try to re-connect
       // the profile if its connection failed and priority
       // for desired profile is ON.

        if((hfConnDevList.isEmpty()) && a2dpConnected &&
            (hsService.getPriority(device) >= BluetoothProfile.PRIORITY_ON)){
        if((hfConnDevList.isEmpty()) &&
            (hsService.getPriority(device) >= BluetoothProfile.PRIORITY_ON) &&
            (a2dpConnected || (a2dpService.getPriority(device) == BluetoothProfile.PRIORITY_OFF))) {
            hsService.connect(device);
        }
        else if((a2dpConnDevList.isEmpty()) && hsConnected &&
            (a2dpService.getPriority(device) >= BluetoothProfile.PRIORITY_ON)){
        else if((a2dpConnDevList.isEmpty()) &&
            (a2dpService.getPriority(device) >= BluetoothProfile.PRIORITY_ON) &&
            (hsConnected || (hsService.getPriority(device) == BluetoothProfile.PRIORITY_OFF))) {
            a2dpService.connect(device);
        }
    }