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
Regards,
Sreekanth
--
unsubscribe: android-porti...@googlegroups.com
website: http://groups.google.com/group/android-porting
-- Ashwin
---------- Forwarded message ----------
From: Ashwin Bihari <abi...@gmail.com>
Date: Fri, Feb 26, 2010 at 8:38 AM
Subject: Re: [android-porting] Re: Power button functionality
(sleep/resume/wakeup)
To: w.sre...@gmail.com
Sreekanth,
Yes, the hardware supports it and the Kernel does as well. My question
is more towards the Android side of things since I know Linux and the
HW are fine.
Regards
-- Ashwin
-- Ashwin
---------- Forwarded message ----------
From: Ashwin Bihari <abi...@gmail.com>
Date: Fri, Feb 26, 2010 at 8:41 AM
Subject: Re: [android-porting] Power button functionality (sleep/resume/wakeup)
To: girish <neo.d...@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
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
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
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 <jebedia...@gmail.com> 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
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
My diff is attached..
-- Ashwin
On Sat, Apr 10, 2010 at 4:49 AM, Jebediah Huang
<jebedia...@gmail.com> wrote:
> Thanks you Ashwin.
>
> Is it possible you share the diff you appli?
Is it possible you share the diff you appli?
On Fri, Apr 9, 2010 at 8:10 PM, Ashwin Bihari <abi...@gmail.com> wrote: