You need this permission:

<uses-permission android:name="android.permission.WAKE_LOCK" />

Be sure to have a read up on the permissions framework, it's pretty
fundamental to Android development.
http://developer.android.com/intl/fr/guide/topics/security/security.html#permissions

SCREEN_DIM_WAKE_LOCK does not dim the screen. It prevents the screen
from automatically turning off (hence the "wake lock" bit), whilst
still allowing the backlight to turn off. The developer docs describe
the command as a "Wake lock that ensures that the screen is on (but
may be dimmed); the keyboard backlight will be allowed to go off."

It sounds like what you really want is to manipulate the screen
brightness in the system settings. I haven't done this before, but you
could try something like:

Settings.System.putInt(getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS, 10);

Take a look at the manual for more info...
http://developer.android.com/intl/fr/reference/android/provider/Settings.System.html



On Tue, Feb 9, 2010 at 3:35 PM, guich <[email protected]> wrote:
> Thanks! Not so obvious to me. :-)
> Where can i see the permissions that have to be set in order to get
> access to a feature? I couldn't find anything in the documentation.
>
> Well, now the lock works, but the screen is still BRIGHT! I'm using a
> G2. Maybe this doesn't work in a G2?
>
> greetings,
>
>   guich
>
> --
> 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

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