summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-02-19 16:26:52 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-03-21 12:22:25 +0000
commit5c94a1ed371e140c91c0687acc719566055cca3e (patch)
tree94e6d49e64b1687e182e34d68448b7ba58c8c905 /android
parent6dc07a184d8c0aae373935b8a6884545d6ab9fa5 (diff)
sdremote: debugging to get a better handle on failed image allocations.
Change-Id: Ic6ea83338d1f821277d97ca368bb0b9f648eeb23 Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'android')
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
index 2135dbfe9686..3925fe258fa7 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
@@ -9,7 +9,9 @@
package org.libreoffice.impressremote.communication;
import org.libreoffice.impressremote.R;
+import org.libreoffice.impressremote.Globals;
+import android.util.Log;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -54,7 +56,14 @@ public class SlideShow {
return BitmapFactory.decodeResource(mContext.getResources(),
R.drawable.image_loading);
}
- Bitmap aBitmap = BitmapFactory.decodeByteArray(aImage, 0, aImage.length);
+ Bitmap aBitmap = null;
+ try {
+ aBitmap = BitmapFactory.decodeByteArray(aImage, 0, aImage.length);
+ } catch (OutOfMemoryError e) {
+ Log.e(Globals.TAG, "Bitmap decoding error byte length: " + aImage.length +
+ "first 4 bytes: " + aImage[0] + " " + aImage[1] + " " + aImage[2] + " " + aImage[3] +
+ "Exception " + e);
+ }
if (aBitmap == null) {
return BitmapFactory.decodeResource(mContext.getResources(),
R.drawable.image_loading);