Fix NPE and don't call UI API from non-UI thread

This change also reverts I29ec3e9f10484f30288fac76f0c45b3707bc2259

Bug: 6956969
Bug: 6891020
Bug: 6947253
Change-Id: I7901c0f9489b4deb79314c2c903b138611bfd78e
6 files changed
tree: 97df9113b76753b823ec9330007a661797b542e6
  1. dictionaries/
  2. java/
  3. native/
  4. tests/
  5. tools/
  6. Android.mk
  7. CleanSpec.mk