Nu3001 / packages_apps_bonovoapps

3 stars 14 forks source link

Connected standby mode #17

Closed lkernan closed 9 years ago

lkernan commented 9 years ago

Adds support to Bonovohandle to delay the activation of airplane mode in standby.

Also adds an option to the MCU Update app standby page to configure the delay time.

jamesgol commented 9 years ago

Awesome. This was on my todo list, ut been crazy busy lately. On Jun 28, 2015 3:39 PM, "Leon Kernan" notifications@github.com wrote:

Merged #17 https://github.com/Nu3001/packages_apps_bonovoapps/pull/17.

— Reply to this email directly or view it on GitHub https://github.com/Nu3001/packages_apps_bonovoapps/pull/17#event-342433931 .

lkernan commented 9 years ago

It wasn't something i needed until I fixed my Wifi reception issues.
Now I can actually use it!

jamesgol commented 9 years ago

Finally got a chance to look at the code. I think 5 min, 15 min, 30min, 60min, forever/infinite would be better times.

I was hoping to switch the regular standby to a seekbar and give more choices but haven't had the chance for that. I never was happy with the times bonovo picked. I think having a 4 hour, 6 hour, 8 hour, 16 hour, 18 hour would be reasonable.

lkernan commented 9 years ago

I wasn't so sure about the power usage, if you think that longer times would be ok i'll change it. Personally i'd use if for small things like syncing mail after getting home, etc.

I'm going to write up a patch tonight anyway. I used milliseconds because that's what the handler used. I didn't think about it until committing and realised that it probably should be at least seconds.

jamesgol commented 9 years ago

Another option would be to stay consistent with what Bonovo does (which IMO is pretty dumb, but at least it would be consistent) and use 10 minute intervals. I'd use 65535 for forever/infinite.

I know my plan was to have it sync music/videos which could take a while if there are a lot of them.

lkernan commented 9 years ago

Hopefully this should cover all bases. There might be one or two that don't need to be there, but I don't see the harm in leaving them.

// Connected Standby delay times (in minutes) private final int CS_OFF= 0; private final int CS_FIVE_MIN= 5; private final int CS_TEN_MIN= 10; private final int CS_HALF_HOUR= 30; private final int CS_ONE_HOUR= 60; private final int CS_FOUR_HOURS= 240; private final int CS_EIGHT_HOURS= 480; private final int CS_HALF_DAY= 720; private final int CS_ONE_DAY= 1440; private final int CS_INFINITE= 65535;

Zaphod-Beeblebrox commented 9 years ago

Why isn't this just a boolean setting (ie, leave network on/off during sleep), and the sleep timer does the rest? Do we really need fine-grain control over sleep and network separately?

lkernan commented 9 years ago

I might have the sleep set at 2 hours but only want it to sync email quickly when I get home.
Why would I leave wifi on wasting battery for 2 hours too?

Zaphod-Beeblebrox commented 9 years ago

I thought initial tests suggested battery draw was not an issue with network on?

lkernan commented 9 years ago

I still have my doubts.

Zaphod-Beeblebrox commented 9 years ago

No worries. If you like it, and want to code it, go for it :) I might could see where a sleep timer of 2 days, and a network timer somewhat lower could benefit battery issues, but for your average 1 to 4 hour sleep timer, I don't see it being an issue.

lkernan commented 9 years ago

Would it help if I changed the options to: Off Ten Minutes One Hour Half Day One Day Always while sleeping

Zaphod-Beeblebrox commented 9 years ago

I haven't look specifically at the code/options. As James mentioned, it might be nice to have this as a slider rather than checkboxes. And the options for Network timer should mirror the sleep timer (even if it means changing the sleep timer options to something more logical for us). And lastly, the network timer should not allow values greater than the sleep timer :)

jamesgol commented 9 years ago

The power draw is low but it is still high enough that I wouldn't want it left on the whole time. If some app was especially chatty it could keep transmitting and potentially wear down the battery especially if someone has an older battery in the winter.