1

Question

Since there is only one Wake-Lock left with 5.0, what is the way to force the device to go out of standby for 2-5 Seconds and then go back black. No interaction, no unlock of keys... just out of standby. All solutions I found work with deprecated Wake-Locks.

I know it´s a bad idea and Google want to forbid it to me... do this for normal apps makes sense, but I work on a scientific app where I need it and can risk the battery drain.

Can I force a deprecated wake lock to work under a newer OS?

Why I need this?/What I do/2 Devices == Different behavoíour

I have a step counter, write the values to a sqlite db - at a alarm i look to the db and ask for the steps. based on this I do some magic.

Sony: With the Sony Xperia Z1 compact it works, because they don´t stop the sensors while Standby. So no batching.

Samsung: Same app, also step counter as sensor. But here I always get 0 steps when I ask for them in my alarm. A workaround: When I start the device out of standby for a moment and go to black again. My alarm can get the right value. And this is what I need. So I want to activate the display before I ask for the steps. Then the batched sensor data must be in the db and I get the right steps.

So any solutions? Wake-Locks over the service runtime, where my step counter is inside, are not working.

Big thank you, and I am sure for this case there is no duplicate Question. Get points and make me happy. Big Thank you for your help!

Julian
  • 11
  • 1
  • After a lot of testing. It seems that the Samsung workaround with activate the standby, is only working when I have S-Health with the step detection activated. I think S-Health is holding a deeper wake lock as a normal app can get. – Julian Jul 13 '15 at 15:50

0 Answers0