This actually does something different -- it prevent the screen from going
into the "dim right before going to sleep" state.  What the original posted
wanted was to force the screen to be full bright (defeat the automatic
brightness control, or override the user's current brightness setting),
which can be done with the WindowManager.LayoutParams.screenBrightness
field:

http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#screenBrightness

Also the vast majority of people should not be using the PowerManager for
SCREEN_BRIGHT_WAKE_LOCK at all, instead using another
WindowManager.LayoutParams API to keep the screen on while their window is
displayed.  This is much less likely to result in application bugs that end
prevent the user's device from going to sleep, and doesn't require that the
application have the power manager permissions:

http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_KEEP_SCREEN_ON

On Mon, Oct 5, 2009 at 9:46 AM, Yusuf Saib (T-Mobile USA) <
yusuf.s...@t-mobile.com> wrote:

>
>
> http://developer.android.com/reference/android/os/PowerManager.html#SCREEN_BRIGHT_WAKE_LOCK
>
>
>
> Yusuf Saib
> Android
> ·T· · ·Mobile· stick together
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
>
> On Oct 5, 6:54 am, bklik <brenton.k...@gmail.com> wrote:
> > I'm getting a lot of requests by users of my flashlight application,
> > that they want me to disable the HTC Hero's automatic dimming feature
> > that works off the light sensor.
> >
> > How do you disable it through code?  Or, isn't there a way?
> >
> > Brenton
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to