summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2014-05-21 18:39:56 +1000
committerJonathan Gordon <rockbox@jdgordon.info>2014-05-21 18:39:56 +1000
commit4b181b4517fad106ab1ffbdab01adac9cf8e4bee (patch)
tree0c212a644e97d733260ddbd8e812f148835f203a
parent8fb0bbcc20e3348193eedc44cd5c9c0fac899ad3 (diff)
Fix android black screen crash
Change-Id: I7a0eb121ff151b8b6e8f824ee8dbab8d99b73499
-rw-r--r--android/src/org/rockbox/RockboxActivity.java1
-rw-r--r--android/src/org/rockbox/RockboxFramebuffer.java7
2 files changed, 8 insertions, 0 deletions
diff --git a/android/src/org/rockbox/RockboxActivity.java b/android/src/org/rockbox/RockboxActivity.java
index a6604418ed..8004046c1b 100644
--- a/android/src/org/rockbox/RockboxActivity.java
+++ b/android/src/org/rockbox/RockboxActivity.java
@@ -111,6 +111,7 @@ public class RockboxActivity extends Activity
{
super.onResume();
setVisible(true);
+ setServiceActivity(true);
}
/* this is also called when the backlight goes off,
diff --git a/android/src/org/rockbox/RockboxFramebuffer.java b/android/src/org/rockbox/RockboxFramebuffer.java
index 405a771274..9c4c6a5dc3 100644
--- a/android/src/org/rockbox/RockboxFramebuffer.java
+++ b/android/src/org/rockbox/RockboxFramebuffer.java
@@ -61,6 +61,9 @@ public class RockboxFramebuffer extends SurfaceView
{
SurfaceHolder holder = getHolder();
Canvas c = holder.lockCanvas();
+ if (c == null)
+ return;
+
btm.copyPixelsFromBuffer(framebuffer);
synchronized (holder)
{ /* draw */
@@ -73,6 +76,10 @@ public class RockboxFramebuffer extends SurfaceView
{
SurfaceHolder holder = getHolder();
Canvas c = holder.lockCanvas(dirty);
+
+ if (c == null)
+ return;
+
/* can't copy a partial buffer, but it doesn't make a noticeable difference anyway */
btm.copyPixelsFromBuffer(framebuffer);
synchronized (holder)