0

When I extend ContentProvider and implement the call() API:

public Bundle call (String authority, 
                String method, 
                String arg, 
                Bundle extras)

If I do a long-running process in for instance the call() call (receiving end) will that somehow stall/break the ContentProvider application/process? I.e. is the call() call handled in a thread-pool and not on the UI-thread, and I can safely do whatever I want for as long as I want inside the call() implementation?

I see some people spinning away threads from within the call() method, but that shouldn't really be necessary on the receiving side, right? It's only on the calling side that we have to do this, correct?

JohnyTex
  • 3,323
  • 5
  • 29
  • 52
  • What do you mean with call() ? – blackapps Nov 12 '21 at 14:57
  • 1
    You are probably on a thread from a small pool of binder threads. For anything substantive, I would fork my own background thread. IOW, don't tie up a thread that you did not create and do not know the rules for its behavior. – CommonsWare Nov 12 '21 at 15:13
  • But if I spin away my own thread then I can no longer return a synchronous result (e.g. Bundle) or an IPC Exception, but have to rely on some other mechanism that would complicate things a whole lot. Hence my question... – JohnyTex Nov 12 '21 at 15:18

0 Answers0