
Calling HandlerThread.quit() or .quitSafely() doesn't immediately terminate the thread. It just instructs the Looper not to accept any new messages and to terminate at the next opportunity. Added a HandlerThread.join() everywhere where the intention is to close and release all resources and to stop all threads. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171525241