Skip to content

Conversation

@JoBolNex
Copy link

@JoBolNex JoBolNex commented Jan 17, 2025

This PR improves the handling of background threads for legacy phone state listening on Android versions below S (API 31). Key changes:

  • Replaced the manual Looper management with a dedicated HandlerThread
  • Added proper cleanup of the HandlerThread by implementing quitSafely() when stopping the listener
  • Moved HandlerThread to a class property to ensure proper lifecycle management and prevent potential memory leaks
  • Removed the blocking Looper.loop() call which could cause issues on the calling thread

@jexodusmercado
Copy link

I applied this fix using patch and fixed my issue with IncomingCall UI not showing but will show if I "restart" my expo server. Kudos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants