Fix NPE in InputMethodServiceTest

This is a follow up CL to my previous CL [1], which introduced NPE
crash bug because of a last minute change during code review.

My intention was to filter out enter event (events that return true
from ImeEvent#isEnterEvent()), my last minute change broke that
because

 1. there was a typo before event.isEnterEvent().
 2. even fixing the above typo, expectEvent() by default doesn't check
    exit events at all (for backward compatibility reasons for
    existing CTS test) hence checking event.isEnterEvent() within
    condition actually doesn't work.

 [1]: I3d5aaf5ac3fcbd3ed047206ed66ec6508e3b3dca
      988f1506456af7887968dab5ffec880a6504be03

Bug: 38513361
Bug: 73626183
Fix: 73896261
Test: atest CtsInputMethodTestCases
Test: Manually verified as follows:
      1. Open an Activity that has a focused EditText
      2. atest CtsInputMethodTestCases:android.view.inputmethod.cts.InputMethodServiceTest#testSetBackDispositionWillNotDismiss
Change-Id: I583feff4f69599cdb96c68ab08ef9fcc8a2f4629
1 file changed