@@ -10,17 +10,18 @@ import android.media.session.MediaController
1010import android.media.session.MediaSessionManager
1111import android.media.session.PlaybackState
1212import android.service.notification.NotificationListenerService
13+ import android.service.notification.NotificationListenerService.RankingMap
1314import android.service.notification.StatusBarNotification
1415import android.util.Base64
1516import android.util.Log
1617import com.sameerasw.airsync.data.local.DataStoreManager
1718import com.sameerasw.airsync.domain.model.MediaInfo
19+ import com.sameerasw.airsync.utils.DeviceInfoUtil
1820import com.sameerasw.airsync.utils.JsonUtil
1921import com.sameerasw.airsync.utils.NotificationDismissalUtil
2022import com.sameerasw.airsync.utils.NotificationUtil
2123import com.sameerasw.airsync.utils.SyncManager
2224import com.sameerasw.airsync.utils.WebSocketUtil
23- import com.sameerasw.airsync.utils.ThirdPartyCallDetector
2425import java.io.ByteArrayOutputStream
2526import kotlinx.coroutines.CoroutineScope
2627import kotlinx.coroutines.Dispatchers
@@ -366,42 +367,6 @@ class MediaNotificationListener : NotificationListenerService() {
366367 sbn?.let { notification ->
367368 Log .d(TAG , " Notification posted: ${notification.packageName} - ${notification.notification?.extras?.getString(Notification .EXTRA_TITLE )} " )
368369
369- // Detect incoming calls from third-party apps (WhatsApp, Skype, Google Meet, etc.)
370- try {
371- val title = notification.notification?.extras?.getString(Notification .EXTRA_TITLE ) ? : " "
372- val body = notification.notification?.extras?.getString(Notification .EXTRA_TEXT ) ? : " "
373-
374- // First check if this is a dialer call (incoming or outgoing)
375- val (contactName, callType) = ThirdPartyCallDetector .detectDialerCallNotification(
376- notification.packageName,
377- title,
378- body
379- ) ? : Pair (null , null )
380-
381- if (contactName != null && callType != null ) {
382- Log .d(TAG , " Dialer call detected: $callType - $contactName " )
383- ThirdPartyCallDetector .recordDialerCall(contactName, callType)
384- } else {
385- // Then check for third-party app calls
386- val (callerName, appName) = ThirdPartyCallDetector .detectCallFromNotification(
387- notification.packageName,
388- title,
389- body
390- ) ? : Pair (null , null )
391-
392- if (callerName != null && appName != null ) {
393- Log .d(TAG , " Incoming call detected from $appName : $callerName " )
394- ThirdPartyCallDetector .recordThirdPartyIncomingCall(
395- notification.packageName,
396- callerName,
397- appName
398- )
399- }
400- }
401- } catch (e: Exception ) {
402- Log .w(TAG , " Error detecting call from notification: ${e.message} " )
403- }
404-
405370 // Skip media processing if media listener is paused or globally disabled
406371 if (! isMediaListenerPaused && isNowPlayingEnabled) {
407372 // Update media info and check for changes (includes like status)
0 commit comments