Fix android black screen crash

Change-Id: I7a0eb121ff151b8b6e8f824ee8dbab8d99b73499
This commit is contained in:
Jonathan Gordon 2014-05-21 18:39:56 +10:00
parent 8fb0bbcc20
commit 4b181b4517
2 changed files with 8 additions and 0 deletions

View file

@ -111,6 +111,7 @@ public class RockboxActivity extends Activity
{ {
super.onResume(); super.onResume();
setVisible(true); setVisible(true);
setServiceActivity(true);
} }
/* this is also called when the backlight goes off, /* this is also called when the backlight goes off,

View file

@ -61,6 +61,9 @@ public class RockboxFramebuffer extends SurfaceView
{ {
SurfaceHolder holder = getHolder(); SurfaceHolder holder = getHolder();
Canvas c = holder.lockCanvas(); Canvas c = holder.lockCanvas();
if (c == null)
return;
btm.copyPixelsFromBuffer(framebuffer); btm.copyPixelsFromBuffer(framebuffer);
synchronized (holder) synchronized (holder)
{ /* draw */ { /* draw */
@ -73,6 +76,10 @@ public class RockboxFramebuffer extends SurfaceView
{ {
SurfaceHolder holder = getHolder(); SurfaceHolder holder = getHolder();
Canvas c = holder.lockCanvas(dirty); Canvas c = holder.lockCanvas(dirty);
if (c == null)
return;
/* can't copy a partial buffer, but it doesn't make a noticeable difference anyway */ /* can't copy a partial buffer, but it doesn't make a noticeable difference anyway */
btm.copyPixelsFromBuffer(framebuffer); btm.copyPixelsFromBuffer(framebuffer);
synchronized (holder) synchronized (holder)