You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
android: use setConnectionProfile instead of (dis)connect on BluetoothProfile (#313)
this prevents android from trying to reconnect to audio itself after we disconnect. this is essentially the same as toggling the 'Media Audio' and 'Phone Calls' settings in the android settings
Copy file name to clipboardExpand all lines: android/app/src/main/java/me/kavishdevar/librepods/services/AirPodsService.kt
+9-30Lines changed: 9 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -2161,11 +2161,6 @@ class AirPodsService : Service(), SharedPreferences.OnSharedPreferenceChangeList
2161
2161
?.getString("name", bluetoothDevice?.name)
2162
2162
if (bluetoothDevice !=null&& action !=null&&!action.isEmpty()) {
2163
2163
Log.d(TAG, "Received bluetooth connection broadcast: action=$action")
2164
-
if (ServiceManager.getService()?.isConnectedLocally ==true) {
2165
-
Log.d(TAG, "Device is already connected locally, checking if we should keep audio connected")
2166
-
if (ServiceManager.getService()?.socket?.isConnected ==true) ServiceManager.getService()?.manuallyCheckForAudioSource() elseLog.d(TAG, "We're not connected, ignoring")
2167
-
return
2168
-
}
2169
2164
if (BluetoothDevice.ACTION_ACL_CONNECTED== action) {
2170
2165
val uuid =ParcelUuid.fromString("74ec2172-0bad-4d01-8f77-997b2be0722a")
2171
2166
bluetoothDevice.fetchUuidsWithSdp()
@@ -2200,19 +2195,6 @@ class AirPodsService : Service(), SharedPreferences.OnSharedPreferenceChangeList
2200
2195
returnSTART_STICKY
2201
2196
}
2202
2197
2203
-
funmanuallyCheckForAudioSource() {
2204
-
val shouldResume =MediaController.getMusicActive() // todo: for some reason we lose this info after disconnecting, probably android dispatches some event. haven't investigated yet.
"For some reason, Android connected to the audio profile itself even after disconnecting. Disconnecting audio profile again! I will resume: $shouldResume"
0 commit comments