Add finishTrackingPendingImeVisibilityRequests

This adds a new test API on ImeTrackerService, along the lines
of hasPendingImeVisibilityRequests, to finish tracking any pending
IME requests and reset the state of ImeTrackerService. This should
fix any issues where other test suites finish with outstanding IME
requests, which could break InputMethodStatsTest.

Bug: 328861282
Test: atest InputMethodStatsTest
Change-Id: I6fd4558755a98ffa9148124101a186c21a00d1da
5 files changed