Throw `takeScreenshotNoSync` if the looper is the main looper
Throw `takeScreenshotNoSync` if the looper is the main looper

Avoids sleeping in Robolectric where the test thread and the main thread are the same thread. `Checks.checkMainThread()` is implemented as a no-op in the default Robolectric implementation so check the looper explicitly as this method structure simply will not work if the looper is the main looper.

PiperOrigin-RevId: 453337076

android/android-test,android/android-test,android/android-test,android/android-test,android/android-test