Fix translation reference gone problem.
1. We save Translator WeakReference in ServiceBinderReceiver.
It has a chance the reference is gone even the session is still
alive. Save Translator instead of WeakReference.
2. Fix not access TranslationManager mTranslators, mTranslatorIds in
the lock.
3. Fix protential NPE of resultData access in ServiceBinderReceiver.
Bug: 192205945
Test: manual. The function works.
Test: atest CtsTranslationTestCases
Change-Id: I158901db4bbcd76203c705ab2a34f1e0b37c7565
2 files changed