react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

Replace android.os.Looper by android.os.HandleThread to prevent blocking main thread

Open JoBolNex opened this issue 11 months ago • 1 comments

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

JoBolNex avatar Jan 17 '25 15:01 JoBolNex

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!

jexodusmercado avatar Mar 03 '25 16:03 jexodusmercado