Fix issue #27408705: Runtime restart: WATCHDOG KILLING SYSTEM PROCESS...
...Blocked in monitor com.android.s
There was a change awhile ago to make the IInstrumentationWatcher
callbacks synchronous, to avoid issues with them spamming non-responsive
watches and filling the binder transfer buffer. However, you can't
just do this, because the activity manager calls these with its
lock held.
To allow them to stay synchronous with the activity manager getting
blocked on the watcher, introduce a new thread for dispatching calls
to the watcher. This thread is created as needed, and dispatches
a queue of callback commands to make to instrumentation watchers.
The callback is still synchronous, so it won't dispatch a new one
until the previous completes.
Change-Id: I8384bd475a1a004c567a4ae20ea64385244f45c5
2 files changed