When the device turns off, and there are no partial wake locks held,
the entire CPU is shut off, so your code simply will not be able to
run until some external event wakes up the CPU again.

As far as reading key events or the countdown timer, there is no way
for applications to do this.  You can get debug info from the power
manager service with "adb shell dumpsys power".

On Oct 5, 8:21 pm, Monroe <[EMAIL PROTECTED]> wrote:
> Thanks Gershon for sharing this information.
> I've been testing the 0.9 and 1.0 SDK and got the same results as you.
>
> I also did one extra wake lock test and the result differs from my
> prediction.
> I wrote a Java program that creates two locks, one partial and one
> full.
> The program first acquires the partial wake lock, then waits for a
> period of time (long enough so that the screen turns off).
> After that it acquires the full lock it created.
> I was expecting the screen to come back on after the full lock is
> acquired, but the it didn't.
> Perhaps I'm not using the Java APIs correctly?
>
> Monroe
>
> On 10月6日, 上午3時10分, Gershon <[EMAIL PROTECTED]> wrote:
>
> > I have a question for Joe and a report for Monroe.
>
> > First the report. For Android 0.9 beta and 1.0, I have gotten the
> > simulator to generally shut off (blank screen) by clicking off Dev
> > Tools->Development Settings->Keep screen on while plugged in. After a
> > minute of no user activity the screen blanks. You then have to click a
> > button to get the lock screen, and then click the Menu button to
> > release the lock screen. I have tested that using the Java code
> > snippet in android.os.PowerManager to acquire a full lock or a
> > SCREEN_DIM_WAKE_LOCK prevents the screen blanking.
>
> > Now for Joe: Is there any way in user Java code to be able to read the
> > KeyEvent or countdown timer to know how long ago the user pressed a
> > key or did something  under all activities?
>
> > --Gershon
>
> > On Aug 10, 12:27 am, Joe Onorato <[EMAIL PROTECTED]> wrote:
>
> > > Hi, I did most of the user space power management functions in
> > > Android.
>
> > > The big thing that you didn't notice is that there are two classes 
> > > ofwakelocks -- kernel and user space.  All of the user space 
> > > partialwakelocks funnel through one partialwakelock, called
> > > PowerManagerService.  The fullwakelocks and user activity countdown
> > > timer are all implemented in java and call on to /sys/android_power/
> > > request_state, which turns the screen on and off (and implicitly, also
> > > keeps the CPU on).  The kernel still has /sys/android_power/
> > > acquire_full_wake_lock, but it is not used.
>
> > > By the time the KeyEventwakelockis released, someone has either
> > > called userActivity on the power manager, which resets the countdown
> > > timer, or they haven't, which means that the device should notwake
> > > up.
>
> > > -joe- 隱藏被引用文字 -
>
> > - 顯示被引用文字 -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Internals" group.
To post to this group, send email to android-internals@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/android-internals?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to