Expose IS_RUNNING_IN_TEST_HARNESS as static method.

This variable is now mutable, making the uppercase format misleading.
For instance, users might assume they can use this value in other
immutable properties, when they really should be accessing the latest
value every time they need it.

Context: https://source.android.com/docs/setup/contribute/code-style#follow-field-naming-conventions

Test: Manual
Bug: 271160958
Change-Id: Iaaa51d9153cb8a7d686c72e1210b1948029dcfd5
This commit is contained in:
Brian Isganitis committed 2023-03-03 00:17:33 +00:00
1 parent aa08af872b
commit fdd044e16e
23 files changed
+40 -40

No files matched your search

@@ -39,13 +39,13 @@ public final class TestLogging {
}
public static void recordEvent(String sequence, String event) {
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
if (Utilities.isRunningInTestHarness()) {
recordEventSlow(sequence, event);
}
}
public static void recordEvent(String sequence, String message, Object parameter) {
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
if (Utilities.isRunningInTestHarness()) {
recordEventSlow(sequence, message + ": " + parameter);
}
}
@@ -58,14 +58,14 @@ public final class TestLogging {
}
public static void recordKeyEvent(String sequence, String message, KeyEvent event) {
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
if (Utilities.isRunningInTestHarness()) {
recordEventSlow(sequence, message + ": " + event);
registerEventNotFromTest(event);
}
}
public static void recordMotionEvent(String sequence, String message, MotionEvent event) {
if (Utilities.IS_RUNNING_IN_TEST_HARNESS && event.getAction() != MotionEvent.ACTION_MOVE) {
if (Utilities.isRunningInTestHarness() && event.getAction() != MotionEvent.ACTION_MOVE) {
recordEventSlow(sequence, message + ": " + event);
registerEventNotFromTest(event);
}