android: fix a2dp connection

This commit is contained in:
Kavish Devar
2025-10-22 17:43:43 +05:30
parent 10fc96dc94
commit 02edb51e41

View File

@@ -1832,7 +1832,7 @@ class AirPodsService : Service(), SharedPreferences.OnSharedPreferenceChangeList
updatedNotification = NotificationCompat.Builder(this, "background_service_status") updatedNotification = NotificationCompat.Builder(this, "background_service_status")
.setSmallIcon(R.drawable.airpods) .setSmallIcon(R.drawable.airpods)
.setContentTitle("AirPods not connected") .setContentTitle("AirPods not connected")
.setContentText("Tap to open app") .setContentText("Tap to open app")
.setContentIntent(pendingIntent) .setContentIntent(pendingIntent)
.setCategory(Notification.CATEGORY_SERVICE) .setCategory(Notification.CATEGORY_SERVICE)
.setPriority(NotificationCompat.PRIORITY_LOW) .setPriority(NotificationCompat.PRIORITY_LOW)
@@ -2179,7 +2179,6 @@ class AirPodsService : Service(), SharedPreferences.OnSharedPreferenceChangeList
fun manuallyCheckForAudioSource() { fun manuallyCheckForAudioSource() {
val shouldResume = MediaController.getMusicActive() val shouldResume = MediaController.getMusicActive()
if (airpodsInstance == null) return
if ((earDetectionNotification.status[0] != 0.toByte() && earDetectionNotification.status[1] != 0.toByte()) || disconnectedBecauseReversed || otherDeviceTookOver) { if ((earDetectionNotification.status[0] != 0.toByte() && earDetectionNotification.status[1] != 0.toByte()) || disconnectedBecauseReversed || otherDeviceTookOver) {
Log.d( Log.d(
TAG, TAG,