Convert threads to AsyncTasks.

Change-Id: I58a36751d8348f82f31013be7d1307b507526c88