Created
May 31, 2016 12:28
-
-
Save bholota/fb84de9a797cd3771871e3bc8b548a56 to your computer and use it in GitHub Desktop.
Wake up before UI test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class BaristaUtils { | |
public static void wakeUp() { | |
InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { | |
@Override | |
public void run() { | |
Window window = new ComponentFinder().findCurrentActivity().getWindow(); | |
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment