Jebediah, Yeah I got the power button functionality working. I'm working with the Donut 1.6 release from Rowboat and I looked at the newer Eclair code as it deals with the POWER button and the handling is changed. So I backported just the changes from one file and the power button now functions as it should. Plus, when I hold the power button down for some longer duration, I get the Power Off dialog..
So check out http://android.git.kernel.org/?p=platform/frameworks/policies/base.git;a=blob;f=phone/com/android/internal/policy/impl/PhoneWindowManager.java and compare it to what you have.. Regards -- Ashwin On Fri, Apr 9, 2010 at 2:38 AM, Jebediah Huang <[email protected]> wrote: > Ashwin, > > Did you get solution to this problem? I've see in testing: > - screen timeout can suspend , no problem > - wake from power button , no problem > - cannot suspend from power button > > pressing power button when system active: > > # getevent > add device 1: /dev/input/event0 > name: "keys" > /dev/input/event0: 0001 0074 00000001 > /dev/input/event0: 0000 0000 00000000 > /dev/input/event0: 0001 0074 00000000 > /dev/input/event0: 0000 0000 00000000 > > $74 = 116 = KeyEvent.KEYCODE_POWER > > Can help me some advice? > > Regards > --Jebediah > > > On Wed, Mar 10, 2010 at 12:37 AM, Ashwin Bihari <[email protected]> wrote: >> Girish, >> >> The device on which we are using Android shouldn't have the keygaurd >> enabled, so I've disabled all of that functionality. The device gets >> to the home screen on bootup, and the idea is to let the screen >> timeout for it to lock itself or use the power button to force the >> lock and the only the power button will unlock/wake up the device back >> to the home screen or wherever it was.. >> >> Do you know where specifically the power button is handled within >> Android to show the lock screen or go to sleep? I've been searching >> for a bit but haven't followed all the source through.. >> >> Regards >> -- Ashwin >> >> >> >> On Mon, Mar 8, 2010 at 12:09 PM, girish <[email protected]> wrote: >>> did you check if hitting the power button locks the screen? You might need >>> to look >>> into that first... >>> >>> -Girish >>> >>> On Mon, Mar 8, 2010 at 9:20 AM, Ashwin Bihari <[email protected]> wrote: >>>> >>>> Girish, >>>> >>>> I do have the power management code within the Kernel enabled since my >>>> screen timeout causes the system to go into the suspend state. I can >>>> then hit the Power button to wake up the system nicely. >>>> >>>> When I do press the Power button while the system is active, I don't >>>> see any messages related to early_suspend, any ideas on what exactly I >>>> should be looking for?? >>>> >>>> Regards >>>> -- Ashwin >>>> >>>> >>>> >>>> On Sat, Feb 27, 2010 at 2:53 AM, girish <[email protected]> wrote: >>>> > Ok, I get your point. Mapping the power key is the first thing to do. >>>> > Rest >>>> > android should take care... >>>> > >>>> > Can you attach your defconfig file, need to check if all the proper >>>> > power >>>> > flags are enabled..which is >>>> > important for android power frmwork to work. >>>> > >>>> > Also, when you press the power key do you see any early_suspend dumps on >>>> > the >>>> > terminal? if it >>>> > does and doesn't go any further to suspend to RAM that means someone is >>>> > holding a wake_lock. >>>> > >>>> > -Girish >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> ---------- Forwarded message ---------- >>>> >> From: Ashwin Bihari <[email protected]> >>>> >> Date: Fri, Feb 26, 2010 at 8:41 AM >>>> >> Subject: Re: [android-porting] Power button functionality >>>> >> (sleep/resume/wakeup) >>>> >> To: girish <[email protected]> >>>> >> >>>> >> >>>> >> Girish, >>>> >> >>>> >> No, I don't want the power button to turn the device off, I've already >>>> >> implemented that at the Kernel level through a different scheme. I >>>> >> want to invoke the Linux Power Manage suspend and resume functionality >>>> >> with the power button through Android. If you take any Android phone >>>> >> right now, there's usually a single button (the top button on the >>>> >> Motorola Droid for example) that when pressed will put the device to >>>> >> sleep if it was awake or wake it up if it was asleep. In the sleep >>>> >> mode the LCD is turned off and the touchscreen doesn't respond to >>>> >> anything. >>>> >> >>>> >> It's basically what happens when you let the screen timeout and the >>>> >> device goes to sleep. The power button allows you to put the device to >>>> >> sleep faster, and that's the functionality I'm trying to implement. >>>> >> >>>> >> I have the power button mapped to KeyEvent.KEYCODE_POWER in my Android >>>> >> build, but that doesn't do anything.. >>>> >> >>>> >> Regards >>>> >> -- Ashwin >>>> >> >>>> >> >>>> >> >>>> >> On Fri, Feb 26, 2010 at 12:05 AM, girish <[email protected]> wrote: >>>> >> > I guess you intend to power off the device when you hit the power >>>> >> > button >>>> >> > right? >>>> >> > >>>> >> > First, the keycode as you mentioned should map Android power key. >>>> >> > Secondly, >>>> >> > you should >>>> >> > have proper hook in baseport level for pm_power_off() for DEVICE OFF. >>>> >> > >>>> >> > >>>> >> > -Girish >>>> >> > >>>> >> > On Wed, Feb 24, 2010 at 9:16 AM, Ashwin Bihari <[email protected]> >>>> >> > wrote: >>>> >> >> >>>> >> >> I've got a custom board designed around the OMAP3530 and we have a >>>> >> >> power button the device that we want to use to cause Android to go >>>> >> >> to >>>> >> >> sleep or wakeup based on it's current state. >>>> >> >> >>>> >> >> I've done a few searches and have figured out the the function >>>> >> >> goToSleep within the PowerManager handles this functionality. For >>>> >> >> the >>>> >> >> power button handler, I'm sending the KEY_POWER eventcode into >>>> >> >> Android..this is mapped appropriately into Andriod as >>>> >> >> KeyEvent.KEYCODE_POWER. However, pressing the button doesn't cause >>>> >> >> anything to happen with Android..what am I missing in making my >>>> >> >> connections? >>>> >> >> >>>> >> >> Regards >>>> >> >> -- Ashwin >>>> >> >> >>>> >> >> -- >>>> >> >> unsubscribe: [email protected] >>>> >> >> website: http://groups.google.com/group/android-porting >>>> >> > >>>> >> > >>>> >> >>>> >> -- >>>> >> unsubscribe: [email protected] >>>> >> website: http://groups.google.com/group/android-porting >>>> > >>>> > >>> >>> >> >> -- >> unsubscribe: [email protected] >> website: http://groups.google.com/group/android-porting >> > -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting To unsubscribe, reply using "remove me" as the subject.
