Skip to content
Commit ee46d18d authored by Mark Punzalan's avatar Mark Punzalan
Browse files

Remove active translation on Activity destroyed

When a translated Activity is destroyed or translation is finished
(e.g., finishTranslation() call), we also have to remove the entry in
the active translations we are keeping track in
TranslationManagerService. Prior to this change, we were not removing
the entry in the Activity destroyed case, and this caused problems when
a new callback is registered (e.g., Gboard) because it would incorrectly
get an onStarted() call for the now-inactive translation.

This can happen relatively frequently when the device has a work
profile, since switching to apps across profiles re-creates the IME, and
in the case of Gboard, it registers a callback every time.

Also added additional logging on Activity destroyed and when callbacks
are registered and triggered.

Bug: 245911471
Test: atest UiTranslationManagerTest
Change-Id: If1881fd4588725021d38e5b9336c3e69bca17039
parent 525739fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment