diff options
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r-- | src/com/android/launcher3/Utilities.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 1acbfc12b..c5f601dcd 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -46,7 +46,6 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.PaintDrawable; import android.os.Build; -import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.os.PowerManager; import android.text.Spannable; @@ -63,9 +62,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 +846,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 |