Fix IME test to be compatible with WindowOnBackInvokedDispatcher

WindowOnBackInvokedDispatcher is intilized with the value of
enableOnBackOnvokedCallback from the ApplicationInfo. If the flag is
disabled in the manifest, callback cannot be registered anymore.

Fix the IME tests relying on manually setting the value of
enableOnBackInvokedCallback on the ApplicationInfo to set the value
before the MockIme and TestActvities gets created

Test: android.view.inputmethod.cts.KeyboardVisibilityControlTest#testHideImeAfterBackPressed_legacyAppLegacyIme \
android.view.inputmethod.cts.KeyboardVisibilityControlTest#testHideImeAfterBackPressed_migratedAppLegacyIme \
android.view.inputmethod.cts.KeyboardVisibilityControlTest#testHideImeAfterBackPressed_migratedAppMigratedIme \
android.view.inputmethod.cts.KeyboardVisibilityControlTest#testHideImeAfterBackPressed_legacyAppMigratedIme
Bug: 235206960

Change-Id: Ie9b5c0be705db835a346f3208922a03680e66877
Merged-In: Ie9b5c0be705db835a346f3208922a03680e66877
(cherry picked from commit 403dd4e5dac320908e8ce273c8f356e62cb6d484)
3 files changed