To list

-- Ashwin




---------- Forwarded message ----------
From: Ashwin Bihari <abih...@gmail.com>
Date: Fri, Feb 26, 2010 at 8:41 AM
Subject: Re: [android-porting] Power button functionality (sleep/resume/wakeup)
To: girish <neo.driz...@gmail.com>


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 <neo.driz...@gmail.com> 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 <abih...@gmail.com> 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: android-porting+unsubscr...@googlegroups.com
>> website: http://groups.google.com/group/android-porting
>
>

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to