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

Commit d900c4d1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Do not autoconnect hfp if hfp is disallowed but a2dp is" am: 70b8b194...

Merge "Do not autoconnect hfp if hfp is disallowed but a2dp is" am: 70b8b194 am: d4a2a895 am: 7a5be1e9 am: 03132fa4 am: a4e6c701

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2082558



Change-Id: I82b96ac06a1706b5f169c53bbeb1552503b4ba89
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b377a12c a4e6c701
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -413,9 +413,10 @@ public class A2dpService extends ProfileService {
            if (!isOutgoingRequest) {
                HeadsetService headsetService = HeadsetService.getHeadsetService();
                if (headsetService != null && headsetService.okToAcceptConnection(device, true)) {
                    Log.d(TAG, "okToConnect: Fallback connection to allowed HFP profile");
                    Log.d(TAG, "okToConnect: return false,"
                            + " Fallback connection to allowed HFP profile");
                    headsetService.connect(device);
                    return true;
                    return false;
                }
            }
            // Otherwise, reject the connection if connectionPolicy is not valid.
+2 −2
Original line number Diff line number Diff line
@@ -2070,10 +2070,10 @@ public class HeadsetService extends ProfileService {
            if (!isOutgoingRequest) {
                A2dpService a2dpService = A2dpService.getA2dpService();
                if (a2dpService != null && a2dpService.okToConnect(device, true)) {
                    Log.d(TAG, "okToAcceptConnection: return temporary true,"
                    Log.d(TAG, "okToAcceptConnection: return false,"
                            + " Fallback connection to allowed A2DP profile");
                    a2dpService.connect(device);
                    return true;
                    return false;
                }
            }
            Log.w(TAG, "okToAcceptConnection: return false, connectionPolicy=" + connectionPolicy);