diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/glwallpaper/ImageProcessHelper.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/glwallpaper/ImageProcessHelper.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageProcessHelper.java b/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageProcessHelper.java index 24a4b9e3052b..231779df6f52 100644 --- a/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageProcessHelper.java +++ b/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageProcessHelper.java @@ -86,7 +86,13 @@ class ImageProcessHelper { protected Float doInBackground(Bitmap... bitmaps) { Bitmap bitmap = bitmaps[0]; if (bitmap != null) { - return new Threshold().compute(bitmap); + try { + return new Threshold().compute(bitmap); + } catch (RuntimeException e) { + Log.e(TAG, "Failed at computing threshold, color space=" + + bitmap.getColorSpace(), e); + return DEFAULT_THRESHOLD; + } } Log.e(TAG, "ThresholdComputeTask: Can't get bitmap"); return DEFAULT_THRESHOLD; @@ -116,7 +122,8 @@ class ImageProcessHelper { int width = bitmap.getWidth(); int height = bitmap.getHeight(); - Bitmap grayscale = Bitmap.createBitmap(width, height, bitmap.getConfig()); + Bitmap grayscale = Bitmap.createBitmap(width, height, + bitmap.getConfig(), false, bitmap.getColorSpace()); Canvas canvas = new Canvas(grayscale); ColorMatrix cm = new ColorMatrix(LUMINOSITY_MATRIX); Paint paint = new Paint(); |