Author Topic: Doze in Nougat  (Read 12011 times)

wevv

  • Newbie
  • *
  • Posts: 2
Doze in Nougat
« on: July 19, 2016, 06:18:28 pm »
Just reading about the updated Doze feature in Nougat, it seems to have changed alot, see here, youtu.be/HBPQZEU_ofg

Since Aqua Mail is probably the only app on the market that allows penetration through Doze, with that said, its still hit and miss sometimes with notifications.

I don't really understand the developer side of things, but is there anything new in Nougat that helps apps properly give notifications while dozing?
From what i read on this site, High-prioity GCM is not possible?? please explain if this is still not possible?
Also is this "Foreground Service" being exempt from Doze new to Nougat?

Ughh theres nothing worse than not getting important emails till the phone is turned on.


Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: Doze in Nougat
« Reply #1 on: July 19, 2016, 11:02:40 pm »
Re: is there anything new in Nougat that helps apps properly give notifications while dozing

There is, but it's the opposite -- they've made it even more restrictive.

N will go into Doze mode immediately upon screen off -- not several hours later like M does.

AquaMail should still be able to check mail every 15 minutes and notify -- but push for IMAP is already a hit and miss on M, and it won't get any better on M (but then it can't really get any worse).

I wonder how "well" Google's own Gmail app will work -- with non-Gmail accounts? Esp. since it has push for Exchange?

Re: GCM

To implement it for IMAP / POP3 accounts, I'd have to have a cloud service, which would need to be able to log into your account -- I mean "from" this cloud service, from my server somewhere.

This is what Outlook / CloudMagic / MyMail / TypeMail do.

I lacked the foresight though, and in any case, I am not in a position to pour as much money into it as those guys do (the cloud side can be expensive).

And then it's a question of trust -- it's perfectly fine for all those apps to store your mail and your passwords, but who's going to trust a "Kostya Vasilyev", is that even a name?

And finally, since the above apps are free -- I won't have anything "different" worth paying for if I tried to play in their sandbox.
« Last Edit: July 19, 2016, 11:05:27 pm by Kostya Vasilyev, Aqua Mail »
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

wevv

  • Newbie
  • *
  • Posts: 2
Re: Doze in Nougat
« Reply #2 on: July 20, 2016, 09:58:21 am »
Re: This is what Outlook / CloudMagic / MyMail / TypeMail do.

Thats a real shame N is becoming more stricter.

Problem is none of those solutions including Gmail/Inbox/BlueMail penetrate Doze like Aquamail does, they may use GCM in normal mode, but not in "high priority mode", i literally just tested them ALL including adding each mail app to a whitelist(ForceDoze is the app i'm using to do this) and your app is the only one that pops up, the rest only receive notifications the moment the screen comes on.
With my job its critical i receive a notification the instant it arrives so i can react,

The weird thing is, my WhatsApp notifications will come through doze, but i've read conflicting reports of people not receiving theirs, and yet these same people are having success with BlueMail, so i dont know, i give up, maybe its time for iOS or something.

Would it be possible for you to introduce a Foreground service, as in a permanent ongoing notification? and warn the user if they turn if off they risk not receiving notifications? from my research this looks like the only way to evade Doze.

Anyway i'd like to support you and purchase your app
« Last Edit: July 20, 2016, 10:18:01 am by wevv »

nadir husain

  • Full Member
  • ***
  • Posts: 106
Re: Doze in Nougat
« Reply #3 on: July 20, 2016, 06:20:50 pm »
I don't have any issues with imap push on M using Aquamail  I suppose because there is always something going on ie calls, text msgs,  emails etc that prevent Doze from kicking in since the " quiet" time required is a couple of hours but it sounds like I might have problems on N if Doze kicks in instanteously.  Your take on this please @Kostya.  Will there be any way to get reliable push notifications on N?

nadir husain

  • Full Member
  • ***
  • Posts: 106
Re: Doze in Nougat
« Reply #4 on: July 20, 2016, 06:23:28 pm »
And why don't they do what they should be doing ie improving battery technology rather than fiddling with the flexibility that makes android the #1 ecosystem on the planet?

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Doze in Nougat
« Reply #5 on: July 20, 2016, 06:48:49 pm »
Improving batteries  is a difficult problem.
And it is hardware. At the software level Google could decrease the activities by Google Crap (Google services) that you are not directly benefiting from. (Those collect information about you, your lovation, etc.)

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: Doze in Nougat
« Reply #6 on: July 22, 2016, 01:08:33 am »
Wheylll....

Quote
Problem is none of those solutions including Gmail/Inbox/BlueMail penetrate Doze like Aquamail does, they may use GCM in normal mode, but not in "high priority mode", i literally just tested them ALL including adding each mail app to a whitelist(ForceDoze is the app i'm using to do this) and your app is the only one that pops up, the rest only receive notifications the moment the screen comes on.

Gmail / Inbox / BlueMail are all supposedly using GCM and I'm sure they can read the docs and see what it says about "priority" mode.

And yet...

On every one of my phones with 6.0, Gmail app is often *hours* behind actual state of things -- as long as those phones remain stationary, which they do a lot.

Now, AquaMail asks to be excluded from Doze mode, maybe that's the difference.

But "priority" GCM is supposed to be "the" official solution to Doze restrictions ("here people, just rewrite your apps, pretty much from scratch, and don't forget to pay for server hosting, oh and we have this Google Cloud you could use").

https://code.google.com/p/android/issues/detail?id=197805

The bug report sort of hints that this is/was a "platform" issue, not app issue.

This then is a mess -- Google puts Doze Mode in place and restricts apps, and GCM is the only way around it, the new official way, no others, and there is a bug which prevents this "official workaround" (app architecture change) from working properly?

Anyone makes mistakes, but the way they put the restrictions in place with an iron fist, before they even know if "the new way" is going to work well -- oh, I should just shut up...
« Last Edit: July 22, 2016, 01:15:56 am by Kostya Vasilyev, Aqua Mail »
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

garfieldthecat

  • Newbie
  • *
  • Posts: 1
Re: Doze in Nougat
« Reply #7 on: August 10, 2016, 12:54:53 pm »
I have found this partial solution works for me.
I am not allowed to post external links, but if you search the  AndroidForums dot com site for
"Marshmallow’s Doze broke push notifications: my fix is preventing Doze with MacroDroid"
you'll find the discussion with all the details.

I use MacroDroid to 'do something' at regular intervals, preventing the phone from entering Doze. The battery usage is OK. It does not solve the issue of getting push with Doze, but it does - indirectly - solve the issue of getting push email on an unrooted Marshmallow device. The post also has details on Aquamail and GCM-based clients; in summary, as of now there is no solution to get proper push email with Doze, because no email app sends high-priority GCM notifications. They could, but they don't. Google has gone crazy.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: Doze in Nougat
« Reply #8 on: August 10, 2016, 10:37:43 pm »
Thank you for this.

And sorry about your not being able to post links -- spam protection for new user registrations.

Meanwhile, here is that link I believe:

http://androidforums.com/threads/marshmallow%E2%80%99s-doze-broke-push-notifications-my-fix-is-preventing-doze-with-macrodroid.1058445/
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

lobstaj

  • Newbie
  • *
  • Posts: 6
Re: Doze in Nougat
« Reply #9 on: July 18, 2017, 07:38:56 am »
Just to get a clear picture: is it nowadays possible to get reliable imap idle push mail on multiple imap folders with aqua mail on nougat?

Yes, I know I would have to exclude aqua mail from the battery optimization and any 3rd party app optimizer and so on. But even then: is it even possible???

I'd be really glad to get an answer on this..
« Last Edit: July 18, 2017, 10:50:46 am by lobstaj »

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: Doze in Nougat
« Reply #10 on: July 18, 2017, 09:08:48 pm »
Re: Just to get a clear picture: is it nowadays possible to get reliable imap idle push mail on multiple imap folders with aqua mail on nougat?

There is no clear answer - it all depends on your mail servers and the network between the device and the server (some networks like aborting the "idle" network connections, and with Doze Mode, the app is only able to check / refresh / re-establish them about every 15 minutes...)
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

lobstaj

  • Newbie
  • *
  • Posts: 6
Re: Doze in Nougat
« Reply #11 on: July 18, 2017, 09:46:55 pm »
Thanks for the answer, which I think is pretty clear: If

1. the imap server implementation works correctly (and doesn't request updates too often) and
2. the network operator doesn't kill idle connections and
3. the app can be put on the whitelist of the power optimization

then imap idle can be implemented to work correctly, despite doze and app standby, I suppose. The thing is that I read google's doze and app standby guidelines the other day and I didn't find any particular thing which would prevent imap idle from working.

I just installed aqua mail today, and based on today's testing it seems to do the job well. Before I was using k9, which had worked great for many years. But somehow it has accumulated some bugs in the last months or so, and this doze problem caused push mail to become "maybe push" mail.

So thanks for the nice app, I hope it'll continue to work :-)

lobstaj

  • Newbie
  • *
  • Posts: 6
Re: Doze in Nougat
« Reply #12 on: July 20, 2017, 01:26:12 pm »
Just my final 5 cents on the subject, in case somebody is intested:

After some 2 days of semi-extensive testing with 2 imap accounts, a total of 5 push folders, sometimes on data connection and sometimes on wifi, I think I can safely say that aqua mail's imap idle push mechanism works reliably on nougat (7.1.1). Of course you need to exclude it from the battery optimization thing, etc.

So in case you're fed up with your previous email client's push mail not working on nougat, this might be your option..

PS: I'm not affiliated with the maker of aqua mail, but I'm just glad I got push mail back. And I'm glad android isn't as bad as it seemed ;-) Doze & co. might make it more difficult to implement working imap idle, but as proven, it's not impossible.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: Doze in Nougat
« Reply #13 on: July 21, 2017, 08:55:23 pm »
Quote
After some 2 days of semi-extensive testing with 2 imap accounts, a total of 5 push folders, sometimes on data connection and sometimes on wifi, I think I can safely say that aqua mail's imap idle push mechanism works reliably on nougat (7.1.1). Of course you need to exclude it from the battery optimization thing, etc.

Thanks, that's good to know!

Quote
Before I was using k9, which had worked great for many years. But somehow it has accumulated some bugs in the last months or so, and this doze problem caused push mail to become "maybe push" mail.

I think they're still in the process of working out "what to do about Doze Mode" and not just push mail but scheduled sync too - and have been for the last year or more.

Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/