[SB Refactor] Move InstantTaskExecutorRule to its own file so it can be
used by other tests.

Any tests that are exercising the `view.repeatWhenAttached` method need
to use this rule; otherwise, we'll get `IllegalStateException: should
be called from the main thread.` error. Moving the rule to its own file
lets us better import it for other tests.

Test: atest RepeatWhenAttachedTest
Bug: 238425913
Change-Id: Icab6b63b419a3898a8be35f16c06a8a3d09db4e2
2 files changed