diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-08-01 08:46:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-08-01 08:46:26 +0000 |
commit | cefbb15656f9373e3b1045724c729b270cf985ac (patch) | |
tree | 5c68b07b9580895f5d1c3dc2ce32d5e91969925d /src | |
parent | 7c8d8a629fe283353601b9bcc70217cf608f04e1 (diff) | |
parent | 1d7f45d8f8fafc46f23963e3b43c95a2c2120079 (diff) | |
download | android_packages_apps_Trebuchet-cefbb15656f9373e3b1045724c729b270cf985ac.tar.gz android_packages_apps_Trebuchet-cefbb15656f9373e3b1045724c729b270cf985ac.tar.bz2 android_packages_apps_Trebuchet-cefbb15656f9373e3b1045724c729b270cf985ac.zip |
Merge "Fixing various tests" into ub-launcher3-dorval-polish2
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/logging/FileLog.java | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java index 21eb3fba0..26f6ec357 100644 --- a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java +++ b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java @@ -71,10 +71,6 @@ public class DefaultAppSearchAlgorithm implements SearchAlgorithm { return result; } - public static boolean matches(AppInfo info, String query) { - return matches(info, query, StringMatcher.getInstance()); - } - public static boolean matches(AppInfo info, String query, StringMatcher matcher) { int queryLength = query.length(); 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) { |