diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-07-31 10:59:52 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-07-31 11:03:54 -0700 |
commit | 1d7f45d8f8fafc46f23963e3b43c95a2c2120079 (patch) | |
tree | 5e8185beb7b7678528ab486caa94868aa1e8e489 /src/com/android/launcher3/logging | |
parent | f880ecca32b10299e3b657a446ce882e004118be (diff) | |
download | android_packages_apps_Trebuchet-1d7f45d8f8fafc46f23963e3b43c95a2c2120079.tar.gz android_packages_apps_Trebuchet-1d7f45d8f8fafc46f23963e3b43c95a2c2120079.tar.bz2 android_packages_apps_Trebuchet-1d7f45d8f8fafc46f23963e3b43c95a2c2120079.zip |
Fixing various tests
> Migrating UI tests to AndroidJUnit4 for better support
> Removing obsolete RotationPreference test
> Fixing broken FileLogTest and AndroidJUnit4
> Removing InvariantDeviceProfileTest as it does not work well with
resource overlays
Change-Id: I0abb1df6765d76d86c1c6c84e8ac35eb9a6bcdaa
Diffstat (limited to 'src/com/android/launcher3/logging')
-rw-r--r-- | src/com/android/launcher3/logging/FileLog.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/launcher3/logging/FileLog.java b/src/com/android/launcher3/logging/FileLog.java index 4c83e9ac2..f7f8ef18f 100644 --- a/src/com/android/launcher3/logging/FileLog.java +++ b/src/com/android/launcher3/logging/FileLog.java @@ -29,6 +29,8 @@ import java.util.concurrent.TimeUnit; */ public final class FileLog { + protected static final boolean ENABLED = + FeatureFlags.IS_DOGFOOD_BUILD || Utilities.IS_DEBUG_DEVICE; private static final String FILE_NAME_PREFIX = "log-"; private static final DateFormat DATE_FORMAT = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); @@ -39,7 +41,7 @@ public final class FileLog { private static File sLogsDirectory = null; public static void setDir(File logsDir) { - if (FeatureFlags.IS_DOGFOOD_BUILD || Utilities.IS_DEBUG_DEVICE) { + if (ENABLED) { synchronized (DATE_FORMAT) { // If the target directory changes, stop any active thread. if (sHandler != null && !logsDir.equals(sLogsDirectory)) { @@ -76,7 +78,7 @@ public final class FileLog { } public static void print(String tag, String msg, Exception e) { - if (!FeatureFlags.IS_DOGFOOD_BUILD) { + if (!ENABLED) { return; } String out = String.format("%s %s %s", DATE_FORMAT.format(new Date()), tag, msg); @@ -102,7 +104,7 @@ public final class FileLog { * @param out if not null, all the persisted logs are copied to the writer. */ public static void flushAll(PrintWriter out) throws InterruptedException { - if (!FeatureFlags.IS_DOGFOOD_BUILD) { + if (!ENABLED) { return; } CountDownLatch latch = new CountDownLatch(1); @@ -135,7 +137,7 @@ public final class FileLog { @Override public boolean handleMessage(Message msg) { - if (sLogsDirectory == null || !FeatureFlags.IS_DOGFOOD_BUILD) { + if (sLogsDirectory == null || !ENABLED) { return true; } switch (msg.what) { |