ok i think ive found the code :

    /** {...@inheritdoc} */
    public boolean preprocessInputEventTq(RawInputEvent event) {
        switch (event.type) {
            case RawInputEvent.EV_SW:
                if (event.keycode == 0) {
                    // lid changed state
                    mLidOpen = event.value == 0;
 
updateRotation(Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
                    if (keyguardIsShowingTq()) {
                        if (mLidOpen) {
                            // only do this if it's opening -- closing
the devi$
                            // off, but it also shouldn't turn it on.
                            mKeyguardMediator.pokeWakelock();
                        }
                    } else {
                        // Light up the keyboard if we are sliding up.
                        if (mLidOpen) {
 
mPowerManager.userActivity(SystemClock.uptimeMillis$
                                    LocalPowerManager.BUTTON_EVENT);
                        } else {
 
mPowerManager.userActivity(SystemClock.uptimeMillis$
                                    LocalPowerManager.OTHER_EVENT);
                        }
                    }
                }

question is how do i edit this to listen for a gpio being changed ?

On Jun 6, 6:57 am, Dianne Hackborn <[email protected]> wrote:
> It is a switch event, I think switch 0.  I don't recall if the switch being
> open corresponds to the lid being open or closed, but it should be obvious
> if it is operating backwards. :}
>
> You can look in PhoneWindowManager for the code that reacts to the switch
> event.
>
>
>
> On Sat, Jun 5, 2010 at 5:35 AM, DJ_Steve <[email protected]> wrote:
> > ok, any ideas what line controls the detection of slide events ?
> > because i cant see anything
>
> > On Jun 5, 1:32 pm, Deva R <[email protected]> wrote:
> > > all key, user input events are processed at
> > > ./frameworks/base/libs/ui/EventHub.cpp
>
> > > On Sat, Jun 5, 2010 at 5:33 PM, DJ_Steve <[email protected]> wrote:
> > > > hello,
> > > > im trying to port android to a nokia n900 device andim wonderign what
> > > > file the code to detect the keyboard being opened (slide out) is in
> > > > and if it can be modified to detect this via a gpio since the n900
> > > > sets a gpio when keyboard is opened. using donut r2
>
> > > > --
> > > > unsubscribe: 
> > > > [email protected]<android-porting%[email protected]>
> > <android-porting%[email protected]<android-porting%[email protected]>
>
> > > > website:http://groups.google.com/group/android-porting
>
> > --
> > unsubscribe: 
> > [email protected]<android-porting%[email protected]>
> > website:http://groups.google.com/group/android-porting
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> 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.

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to