Closed jungoo8512 closed 13 years ago
Following link is about the issue: OnSensorChanged() is no longer called in standby mode: still broken (2.2 Froyo)
These phones are not working at the moment :(
This is a handset rather than operating system version issue, though on some handsets it works fine before an operating system upgrade and fails after. With the screen off accelerometers work on some handsets and not others, for example the Nexus One handset with Froyo 2.2 works fine with our code but HTC Desire with Froyo 2.2 doesn't work. Others have found code work arounds that work on some handsets but not others. The proposed solution for our case is to provide a set up option which when set:-
Can switch on screen with ACQUIRE_CAUSES_WAKEUP See http://developer.android.com/reference/android/os/PowerManager.html#ACQUIRE_CAUSES_WAKEUP
On HTC Desire HD can not turn screen on in software once it has been turned off but can keep screen on. Added check box to keep screen on on settings screen. Sony Ericcson X10A can turn on screen with software.
Doesn't occur on Sony Erricson xperia X10A. Doesn't occur on Nexus S, doesn't occur on Samsung S version 2.1 but does on version 2.2. Does occur on HTC Desire and HTC Desire HD.
Fixed. Check box added to keep screen on for phones with the problem.
It was issued on Firmware 2.1 but it works fine on Nexus One v2.2 Froyo. According to this guy(http://stackoverflow.com/questions/2143102/accelerometer-stops-delivering-samples-when-the-screen-is-off-on-droid-nexus-one), sensors now work again when the screen is off if you have a PARTIAL_WAKELOCK on Nexus One, which we have that code as well. That's why it only works on Ken's phone. It seems this code doesn't work in other phones especially HTC?
There is an harsh way to make the screen on when it goes off, but that would be the perfect way to quickly consume the battery.
Still need to figure out.