Not using a WakeLock so why does the device stay awake?

by MrChaz » Tue, 13 Apr 2010 17:16:57 GMT


Sponsored Links
 iirc, that flag means the system gets a wake lock for the life of the
activity for you.




--



Not using a WakeLock so why does the device stay awake?

by westmeadboy » Tue, 13 Apr 2010 17:19:20 GMT


 Oh I see.

So if the user presses Home and then uses the power button, then it
*could* fall asleep (in the case where the activity has been killed by
the system)?





--


Sponsored Links


Not using a WakeLock so why does the device stay awake?

by westmeadboy » Wed, 14 Apr 2010 15:45:23 GMT


 Just to confirm: the device is not plugged into USB and I'm not using
any broadcasts or broadcast receivers.

When I do plug in and start the service these are the wake locks:

mLocks.size=3:
  SCREEN_DIM_WAKE_LOCK           'StayOnWhilePluggedIn Screen Dim'
activated (minState=1)
  PARTIAL_WAKE_LOCK              'StayOnWhilePluggedIn Partial'
activated (minState=0)
  SCREEN_BRIGHT_WAKE_LOCK        'KEEP_SCREEN_ON_FLAG' activated
(minState=3)

and then when I homescreen, other app, turn the screen off (as
describe above) but leave the device plugged in, the third one
disappears.

So I would assume that when I unplug the USB, the first two to
disappear also...







> >



Not using a WakeLock so why does the device stay awake?

by THill » Fri, 23 Apr 2010 03:51:12 GMT


 hanks Dianne, that makes sense.

I didn't realize there was essentially one wake lock that the kernel &
applications layer use, so when all apps give up the wake lock, they
will still get awaken when the cpu wakes to handle kernel processes.

This explains why the 1-second timer pops occurred at 1 second
intervals before & after the sleep, and at very erratic intervals
during the sleep.

I saw the same behavior on a similar test case with an AsyncTask
sending messages through a handler to the UI. Neither the task, nor
the handler, was completely frozen during the sleep, but the task was
taking longer to complete during that time.

Unfortunately, my production app has specific power usage constraints
imposed by the manufacturer/carrier (especially with the device
asleep), and it doesn't seem there is a good way to make sure the app
completely goes dormant when the device sleeps. Any suggestions are
welcome.

Cheers
Tim

On Apr 22, 10:58am, Dianne Hackborn <hack...@android.com> wrote:
> >



Other Threads

1. How to drag and drop items of ListView?

Hi,

    I have to drag and drop items of ListView,which typically have an
image and text.

    How can i implement this.


Thanks in advance.

-- 

2. converting ycbcr 420 to rgb

Hi,
I want to display the preview frames of an android smartphone on an
opengl texture. As opengl es only support RGB and the preview frame is
encoded with YCbCr 4:2:0. Therefor I have to convert from one to the
other. Though I wasn't successful in doing so, so far. Maybe someone
can help me with it. I found some sources/example code here:

http://groups.google.de/group/android-developers/browse_thread/thread/c85e829ab209ceea/adca218ec3555c81?lnk=gst&q=ycbcr+420+rgb#adca218ec3555c81
http://www.netmite.com/android/mydroid/donut/development/tools/yuv420sp2rgb/yuv420sp2rgb.c
http://blog.tomgibara.com/post/132956174/yuv420-to-rgb565-conversion-in-android

my code can be found here:
http://code.google.com/p/andar/source/browse/#svn/trunk/AndOpenGLCam/src/edu/dhbw/andopenglcam
especially the classes CameraPreviewHandler.java and
OpenGLCamRenderer.java are important.

When using the example from the android project(http://tinyurl.com/
y9l36tl) it results in this:
http://picfront.de/d/Saj1pYfo4/IMG_7715.jpg

I can get the best result from using the outcommented formula from
(http://tinyurl.com/y9l36tl) and inverting RGB in BGR:
http://picfront.de/d/x4iMqes9/IMG_7717.jpg
it shows red planes in green and some blue edges around everything...

any help is appreciated :D

3. Getting a TextView to span the length of the screen

4. Customised grid

5. Need help for a proper way of using Listview paired with a background process

6. if second application installed on phone then first will not found

7. installing multiple apks