summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Utilities.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-05-06 09:58:34 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-05-09 12:47:42 -0700
commit713edfce264db7edc409216d5c083f8dd6a7083f (patch)
tree0928bb5e71f542885ad9364875413b19f759f407 /src/com/android/launcher3/Utilities.java
parent3074965cdb63adc8f834afefb282f43d3d9e4c2f (diff)
downloadandroid_packages_apps_Trebuchet-713edfce264db7edc409216d5c083f8dd6a7083f.tar.gz
android_packages_apps_Trebuchet-713edfce264db7edc409216d5c083f8dd6a7083f.tar.bz2
android_packages_apps_Trebuchet-713edfce264db7edc409216d5c083f8dd6a7083f.zip
Adding a utility class for persistant logging.
The logs are kept for at max 48 hours. It uses two log files and switches between the two based on the day of the year. Change-Id: I9a99499b3445a62f29f62a5cd13db20b1783bcd3
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r--src/com/android/launcher3/Utilities.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index 1acbfc12b..871f39045 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -63,9 +63,11 @@ import android.widget.Toast;
import com.android.launcher3.compat.UserHandleCompat;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.config.ProviderConfig;
import com.android.launcher3.util.IconNormalizer;
import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -845,6 +847,18 @@ public final class Utilities {
return true;
}
+ public static void closeSilently(Closeable c) {
+ if (c != null) {
+ try {
+ c.close();
+ } catch (IOException e) {
+ if (ProviderConfig.IS_DOGFOOD_BUILD) {
+ Log.d(TAG, "Error closing", e);
+ }
+ }
+ }
+ }
+
/**
* An extension of {@link BitmapDrawable} which returns the bitmap pixel size as intrinsic size.
* This allows the badging to be done based on the action bitmap size rather than