diff options
Diffstat (limited to 'common/src/com/android/tv/common/TvCommonUtils.java')
-rw-r--r-- | common/src/com/android/tv/common/TvCommonUtils.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/common/src/com/android/tv/common/TvCommonUtils.java b/common/src/com/android/tv/common/TvCommonUtils.java index c391ad24..a88dd3a8 100644 --- a/common/src/com/android/tv/common/TvCommonUtils.java +++ b/common/src/com/android/tv/common/TvCommonUtils.java @@ -23,8 +23,6 @@ import android.media.tv.TvInputInfo; * Util class for common use in TV app and inputs. */ public final class TvCommonUtils { - private static Boolean sRunningInTest; - private TvCommonUtils() { } /** @@ -60,15 +58,12 @@ public final class TvCommonUtils { * the usual devices even the application is running in tests. We need to figure it out by * checking whether the class in tv-tests-common module can be loaded or not. */ - public static synchronized boolean isRunningInTest() { - if (sRunningInTest == null) { - try { - Class.forName("com.android.tv.testing.Utils"); - sRunningInTest = true; - } catch (ClassNotFoundException e) { - sRunningInTest = false; - } + public static boolean isRunningInTest() { + try { + Class.forName("com.android.tv.testing.Utils"); + return true; + } catch (ClassNotFoundException e) { + return false; } - return sRunningInTest; } } |