That sounds most likely (bug in platform).  I've only been able to
reproduce it on 1.5 and 1.6, not 2.0 or 2.1...

So I guess that returns me to my original question:
Is there any way I can detect this state in my code (I guess I don't
mind polling when viewing this Activity).  If so, what's the right
thing to do? Is there a way to release the lock?  Can I just kill the
app?  I guess the main goal is to avoid timing out and show the "wait/
force close" message in this case.

Thanks.




On Jul 21, 7:34 pm, Dianne Hackborn <[email protected]> wrote:
> What version of the platform are you running against?  It could just be a
> bug in the platform.
>
>
>
> On Wed, Jul 21, 2010 at 11:17 AM, Matty <[email protected]> wrote:
> > My OpenGL stuff seems to draw just fine until some rotate (this is
> > most reproducible if you rotate back and forth with about a second
> > between).
>
> > Note that Activity B is "singleTop"
>
> > Here's a log from the normal startup:
> > I/System.out(17209): Activity A:onCreate()
> > I/System.out(17209): Start Activity B from Activity A
> > I/System.out(17209): Activity B:onCreate()
> > I/System.out(17209): Activity B:onResume()
>
> > When I rotate and things are fine:
> > I/System.out(17209): Activity B:onPause()
> > I/System.out(17209): Activity B:onDestroy()
> > I/System.out(17209): Activity B:onCreate()
> > I/System.out(17209): Activity B:onResume()
> > I/System.out(17209): Activity A:onCreate()
> > I/System.out(17209): Start Activity B from Activity A
> > I/System.out(17209): Activity B:onPause()
> > I/System.out(17209): Activity B:onResume()
>
> > So it's actually restoring B before re-creating activity A... But then
> > A resumes B...  I think it's doing B-then-A because A is shown through
> > the translucent activity B? For normal cases this works fine...
>
> > I was able to reproduce the issue by rotating back and forth
> > repeatedly...  I sort of had to do it while the screen stayed grey, so
> > I'm not sure exactly when the problem started, but I'm seeing
> > something useful from the log:
> > I/System.out(17910): Start Activity B from Activity A
> > I/System.out(17910): Activity B:onPause()
> > I/System.out(17910): Activity B:onResume()
> > I/System.out(17910): Activity B:onPause()
> > I/System.out(17910): Activity B:onDestroy()
> > I/System.out(17910): Activity B:onCreate()
> > I/System.out(17910): Activity B:onResume()
> > I/System.out(17910): Activity B:onPause()
> > I/System.out(17910): Activity B:onDestroy()
> > I/System.out(17910): Activity B:onCreate()
> > I/System.out(17910): Activity B:onResume()
> > I/System.out(17910): Activity B:onPause()
> > I/System.out(17910): Activity B:onDestroy()
> > I/System.out(17910): Activity B:onCreate()
> > I/System.out(17910): Activity B:onResume()
> > I/System.out(17910): Activity B:onPause()
> > I/System.out(17910): Activity B:onDestroy()
>
> > It looks like when you rotate that fast, Android doesn't even get to
> > tell anything to Activity A!  Somehow it got lost, and after that, I
> > see continuing messsages of:
> > W/SurfaceComposerClient(17910): lock_layer timed out (is the CPU
> > pegged?) layer=2, lcblk=0x420d0120, state=0000000e (was 0000000e)
>
> > Is there any way around this? Am I being to mean with my rotations?
>
> > On Jul 21, 1:12 pm, Dianne Hackborn <[email protected]> wrote:
> > > Have you made sure your SurfaceView UI is actually drawing regularly, and
> > > especially redrawing itself as soon as possible with the new size?
>
> > > On Wed, Jul 21, 2010 at 8:02 AM, Matty <[email protected]> wrote:
> > > > Thanks for the quick response Dianne.
>
> > > > I have an activity that uses OpenGL, and if I rotate  at just the
> > > > right time, the log prints
>
> > > > W/SurfaceComposerClient(  749): lock_layer timed out (is the CPU
> > > > pegged?) layer=2, lcblk=0x420d0120, state=0000000e (was 0000000e)
>
> > > > I basically don't want the Activity to hang.  I'm using a plain
> > > > android.opengl.GLSurfaceView.
>
> > > > There are 2 activities involved. A,B.  B is started from A using
> > > > startActivityForResult, and is "translucent".  On rotate, both finish,
> > > > and then I start A (which might work) which then starts an intent for
> > > > B.  If I rotate at the right time, I see the message above, and
> > > > sometimes Activity A draws properly, but usually not quite (only draws
> > > > some of the screen, or a rotated version of the opposite orientation),
> > > > and it seems like B is somehow blocked because of the message above.
> > > > Activity B has the GLSurfaceView.
>
> > > > Any advice is greatly appreciated.
>
> > > > On Jul 21, 9:22 am, Dianne Hackborn <[email protected]> wrote:
> > > > > What problem is this causing you that you are trying to fix?
>
> > > > > On Wed, Jul 21, 2010 at 5:47 AM, Matty <[email protected]> wrote:
> > > > > > I have looked through many posts on this issue, and I've concluded
> > > > > > that there's not much I can do to prevent it... I am able to
> > reproduce
> > > > > > this error when repeatedly rotating an Activity that uses OpenGL.
>
> > > > > > W/SurfaceComposerClient(  749): lock_layer timed out (is the CPU
> > > > > > pegged?) layer=2, lcblk=0x420d0120, state=0000000e (was 0000000e)
>
> > > > > > For reference:
> > > > > > I'm calling GLSurfaceView.onPause() and onResume() on activity
> > pause
> > > > > > and resume...
>
> > > > > > My question is:
> > > > > > Can I detect this error in my java code, so I can try to do
> > something
> > > > > > extra to correct it?
> > > > > > Is there an ErrorListener, or an object I can access to find out
> > about
> > > > > > when this occurs? I have tried
> > > > > > ((EGL10) EGLContext.getEGL()).eglGetError();
> > > > > > but does not report an error.  I'm guessing I'd need some sort of
> > > > > > Surface object?
>
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google
> > > > > > Groups "Android Developers" group.
> > > > > > To post to this group, send email to
> > > > [email protected]
> > > > > > To unsubscribe from this group, send email to
> > > > > > [email protected]<android-developers%[email protected]>
> > <android-developers%[email protected]<android-developers%[email protected]>
>
> > > > <android-developers%[email protected]<android-developers%[email protected]>
> > <android-developers%[email protected]<android-developers%[email protected]>
>
> > > > > > For more options, visit this group at
> > > > > >http://groups.google.com/group/android-developers?hl=en
>
> > > > > --
> > > > > Dianne Hackborn
> > > > > Android framework engineer
> > > > > [email protected]
>
> > > > > Note: please don't send private questions to me, as I don't have time
> > to
> > > > > provide private support, and so won't reply to such e-mails.  All
> > such
> > > > > questions should be posted on public forums, where I and others can
> > see
> > > > and
> > > > > answer them.
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Android Developers" group.
> > > > To post to this group, send email to
> > [email protected]
> > > > To unsubscribe from this group, send email to
> > > > [email protected]<android-developers%[email protected]>
> > <android-developers%[email protected]<android-developers%[email protected]>
>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > [email protected]
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> > and
> > > answer them.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to