1

I have seen many apps that give the ability to wake up phone screen simply by picking the phone up off a table (not talking about proximity sensor here). One thing they all have in-common is that this feature places a wakelock on the device, and therefore it drains battery, and therefore it times out after a preset amount (1-10 minutes). From what I understand, it works by monitoring front camera.

My question is: how do Moto X and Nexus phones do that then? They have this feature in-built, but does that also place a wakelock? A 24-hour wakelock? Or do they use something other than front camera? And if such, why isn't there an app that can replicate this behaviour for all phones?

  • Using the accelerometer would be simple, I have no doubt that there is an app that can do this. – Matthew Read Mar 23 '16 at 16:51
  • 2
    My first guess would be that there's a low-power co-processor monitoring the accelerometer, so it can work without keeping the main processor awake. This isn't something that's exposed in the Android SDK, so any app doing this would be device-specific. – Dan Hulme Mar 23 '16 at 17:06
  • Well, there is an app that monitors the accelerometer to lock/unlock the phone, Gravity Screen. For the devices that have this capability built-in I agree with @Dan Hulme. – user127476 Mar 23 '16 at 22:06
  • 1
    @NicolaBastianello Good find. I see that the app's description says, "However [battery use] can be much higher by often using the Turn Screen On by Motion feature. Thus, keep your phone face down if you want to save energy." So maybe that mode uses a wakelock and the others use Google Play Services activity detection? – Dan Hulme Mar 23 '16 at 22:26
  • 1
    @NicolaBastianello I have that installed. It uses a wakelock, and sets a configurable timeout, default of 10 minutes. After that time, the device no longer wakes on pickup (the proximity sensor continues to work however) – Slav Mar 24 '16 at 5:38
2

Devices like Moto X and Nexus 5X/6P use a sensor hub to achieve this feature, which is a:

microcontroller unit/coprocessor/DSP that helps to integrate data from different sensors and process them. This technology can help off-load these jobs from a product's main central processing unit, thus saving battery consumption and providing a performance improvement.

The Android specifications suggest that the manufacturer implement a sensor hub:

The sensor stack of a device can optionally include a sensor hub, useful to perform some low-level computation at low power while the SoC can be in a suspend mode. For example, step counting or sensor fusion can be performed on those chips. It is also a good place to implement sensor batching, adding hardware FIFOs for the sensor events. See Batching for more information.

How the sensor hub is materialized depends on the architecture. It is sometimes a separate chip, and sometimes included on the same chip as the SoC. Important characteristics of the sensor hub is that it should contain sufficient memory for batching and consume very little power to enable implementation of the low power Android sensors. Some sensor hubs contain a microcontroller for generic computation, and hardware accelerators to enable very low power computation for low power sensors.

So the availability of this feature depends on the hardware of the device: if the manufacturer includes a sensors hub, then the power consumption will be optimized because the central processor isn't involved. Otherwise, the only possibility is to install dedicated apps (see for example the one cited in my comment) that will monitor the accelerometer, resulting, though, in a higher battery drain.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.