diff options
author | 2022-04-28 11:04:40 -0700 | |
---|---|---|
committer | 2022-04-30 16:32:29 -0700 | |
commit | a1ca66fe75837d5f7c39aa57d3dc99705576221f (patch) | |
tree | d6721cf544da5ef8e7b437e75a075e886e98d822 | |
parent | 39eb41b55474b667b57edbf2471d0dc0c7c6dc87 (diff) |
fix log spewing coming from Telecom#LogUtils
LogUtils was causing a ~7k line log spew in the
utomation tests.
new var created in Telecom Log Frameworks file that can
gate ceratin lines causing log spew.
bug: 224667124
Test: manual, looked through test logs and log spew lines removed
Change-Id: I5aac180832c0c26af201d1286727cc3e9c67d207
-rw-r--r-- | telecomm/java/android/telecom/Log.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/Log.java b/telecomm/java/android/telecom/Log.java index 922eddb6ac3e..884dcf2dfbad 100644 --- a/telecomm/java/android/telecom/Log.java +++ b/telecomm/java/android/telecom/Log.java @@ -76,6 +76,11 @@ public class Log { private static boolean sIsUserExtendedLoggingEnabled = false; /** + * Enabled in telecom testing to help gate log statements causing log spew. + */ + private static boolean sIsUnitTestingEnabled = false; + + /** * The time when user-activated extended logging should be ended. Used to determine when * extended logging should automatically be disabled. */ @@ -330,6 +335,20 @@ public class Log { } } + /** + * Enabled when tests are running to help gate log statements causing log spew. + * + * @param isEnabled {@code true} if running unit tests. false otherwise. + * + */ + public static void setUnitTestingEnabled(boolean isEnabled) { + sIsUnitTestingEnabled = isEnabled; + } + + public static boolean isUnitTestingEnabled() { + return sIsUnitTestingEnabled; + } + private static EventManager getEventManager() { // Checking for null again outside of synchronization because we only need to synchronize // during the lazy loading of the events logger. We don't need to synchronize elsewhere. |