AFAIK, this is not possible, outside of a custom build of Android.

On Sat, Aug 4, 2012 at 3:40 PM, macias <[email protected]> wrote:
> Hello all,
>
>   IN SHORT:
> I need to get instance of PowerManagerService (in order to call its method
> isScreenBright). However I am unable to do it, after reading Android
> sources, the closest guess was to get it (via reflection) from
> android.os.ServiceManager by calling getService. The problem is the
> resulting class name is BinderProxy (the class name of the object which I
> get after actual invoke of getService), not PowerManagerService and I am
> stuck at this point. The types have to match in order to continue working
> with reflection invoking.
>
>   BACKGROUND STORY (safe to skip it):
> I try to read real brightness of the screen (not the one that should be set,
> but the real one). All top level brightness readers method return
> theoretical values (most likely -- from settings), so when phone lowers it
> automatically, those top level methods get the same result despite, the
> brightness changed. I figured out, I try isScreenBright method, it should
> tell me if phone is in normal brightness mode, or in power save mode (source
> code which sets this mode look promising anyway).
>
> Thank you in advance.
>
>
> --
> 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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.0 Available!

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