Hi,

I'm trying to develop something similar to the proximity event of the dialer
during a call, this is: when something is near the proxmity sensor turn off
the screen and when there's not power it on again.

I've had no problem making the sensor's events work, that was easy, but I'm
having a lot of trouble trying to set the screen on/off, this is what I've
got this far:

   - I can power the screen off by setting brightness to zero (using the
   WindowManager.LayoutParams), the problem is that it locks the screen instead
   of just setting it off.
   - I've tried using a PowerManager.WakeLock to several things:
      - using as flag PARTIAL_WAKE_LOCK which should keep the cpu running
         but allowing the screen and keyboard to go off (but not
actually setting
         them off at the moment, it waits for the configured timeout)
         - using as flag SCREEN_DIM_WAKE_LOCK | ACQUIRE_CAUSES_WAKEUP and
         then setting the screen off using the brightness "trick" but
I still do have
         to manually press the button to bring the screen up.

Now, I'm playing with some flags in the Window, but still nothing, I always
do have to bring the screen back by pressing the power button.

Any ideas/snippets to make this work like when you're inside a call in
Android's default dialer?

Thanks! :)

-- 
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