[Q] CM9 & Email subfolder notification

Thenetstriker

Senior Member
Jul 24, 2008
163
104
0
Thank you so much! This has got to be the best mod to the email apk! How is the review going? When can we expect this to be merged?

Working on 10.2
The patch was reviewed by Danny Baumann and Marco Brohet. The found some code styling issues, so I've uploaded a corrected patch, but they did not review the patch again. (Since about two weeks) I've already sent Marco Brohet a mail, but did not get any response. I hope they will review the patch again soon.
 
  • Like
Reactions: phubarr and mrd7rs

dhaliwal925

Senior Member
Aug 20, 2012
89
14
0
The patch was reviewed by Danny Baumann and Marco Brohet. The found some code styling issues, so I've uploaded a corrected patch, but they did not review the patch again. (Since about two weeks) I've already sent Marco Brohet a mail, but did not get any response. I hope they will review the patch again soon.
For your information, your most recent build has been working flawlessly on my CM 10.2 HTC One. I love it! :D
 

edzilla

Senior Member
Jan 14, 2007
175
12
0
I just installed your mod on my HTC One on CM10.2, it works great.
I'm hopping you'll be able to get it integrated to the main CM tree!
 

haltok

New member
Aug 2, 2013
4
0
0
I just installed your mod on my HTC One on CM10.2, it works great.
I'm hopping you'll be able to get it integrated to the main CM tree!

As of CM nightly 11/18 seems to be crashing email when installing it. I have used this app for months and it has really worked well. I am not sure what CM changed to cause this issue. I have four different reports of it happening.

On another note, i have played with the new KK email client and really like it except for the fact that it doesn't alert on subfolders. Are you planning on integrating your fix for this in the new email client?

thanks for all your work
 

Navik57

Senior Member
Sep 21, 2009
138
6
0
El Paso
Not sure if anyone else is seeing this... but it seems it will constantly notify me when an email for a subfolder comes in, even after dismissing the notification. The only way to stop it is to actually view the email.

Get's a tad annoying when all I wanna do is skim it, and dismiss if it isn't important.

Other than that, love the mod!
 

Thenetstriker

Senior Member
Jul 24, 2008
163
104
0
I've just looked at the email app source from Android 4.4 and there are a lot of changes in the background too. It will take some time to reimplement my patch into the new source. I will paste the apk here as soon as I've got a first working version for testing.
@Navik57: I've also tried to reproduce your problem, but my notifications did not reappear wenn I've dismissed the notification. Can you tell me exactly how you configured your email account and how you can reproduce this problem? Did you also tried to delete the email app data completeley and setup your email account again?
 
  • Like
Reactions: phubarr

Thenetstriker

Senior Member
Jul 24, 2008
163
104
0
I've got good news regarding email notifications in Android 4.4. It seams as subfolder notifications are already possible, only the configuration option to enable the notifications seams to be missing. But using a root file manager (e.g. Root Explorer) the settings can be added manually.

First you have to write down the serverids of the folders you want to be notified. These ids could be found in the sqlite DB of the email app in the mailbox table. (use e.g. SQLite Editor to read the table directly on the phone) The second step would be to encode these numbers to base64. (This is the way Android defines a unique name for the config file) On the following website you can encode the serverids to the base64 string: http://www.motobit.com/util/base64-decoder-encoder.asp

For e.g. the serverid 17 the base64 string would be MTc= but in the file you will have to enter only MTc. The config files are stored in the folder /data/data/com.android.email/shared_prefs. The eaisiest way to make the preferences for your folders would be to copy the preference file for your inbox and then rename the file. The file is named like this: Folder-YOURACCOUNTNAME-BASE64STRING.xml. Just make a copy of the file and set the base64 string for your folder. (Notifications should already be enabled in the xml file)

When you've done this for all the folders where you want the notifications restart your phone (Android does not seam to register the files without restarting the phone) and short after that you should receive the notifications.
 

briangig

Senior Member
Sep 13, 2012
56
5
0
I've got good news regarding email notifications in Android 4.4. It seams as subfolder notifications are already possible, only the configuration option to enable the notifications seams to be missing. But using a root file manager (e.g. Root Explorer) the settings can be added manually.

First you have to write down the serverids of the folders you want to be notified. These ids could be found in the sqlite DB of the email app in the mailbox table. (use e.g. SQLite Editor to read the table directly on the phone) The second step would be to encode these numbers to base64. (This is the way Android defines a unique name for the config file) On the following website you can encode the serverids to the base64 string: http://www.motobit.com/util/base64-decoder-encoder.asp

For e.g. the serverid 17 the base64 string would be MTc= but in the file you will have to enter only MTc. The config files are stored in the folder /data/data/com.android.email/shared_prefs. The eaisiest way to make the preferences for your folders would be to copy the preference file for your inbox and then rename the file. The file is named like this: Folder-YOURACCOUNTNAME-BASE64STRING.xml. Just make a copy of the file and set the base64 string for your folder. (Notifications should already be enabled in the xml file)

When you've done this for all the folders where you want the notifications restart your phone (Android does not seam to register the files without restarting the phone) and short after that you should receive the notifications.
Going to try this tonight. If this works, I will be one happy KitKat user.
 

briangig

Senior Member
Sep 13, 2012
56
5
0
I've got good news regarding email notifications in Android 4.4. It seams as subfolder notifications are already possible, only the configuration option to enable the notifications seams to be missing. But using a root file manager (e.g. Root Explorer) the settings can be added manually.

First you have to write down the serverids of the folders you want to be notified. These ids could be found in the sqlite DB of the email app in the mailbox table. (use e.g. SQLite Editor to read the table directly on the phone) The second step would be to encode these numbers to base64. (This is the way Android defines a unique name for the config file) On the following website you can encode the serverids to the base64 string: http://www.motobit.com/util/base64-decoder-encoder.asp

For e.g. the serverid 17 the base64 string would be MTc= but in the file you will have to enter only MTc. The config files are stored in the folder /data/data/com.android.email/shared_prefs. The eaisiest way to make the preferences for your folders would be to copy the preference file for your inbox and then rename the file. The file is named like this: Folder-YOURACCOUNTNAME-BASE64STRING.xml. Just make a copy of the file and set the base64 string for your folder. (Notifications should already be enabled in the xml file)

When you've done this for all the folders where you want the notifications restart your phone (Android does not seam to register the files without restarting the phone) and short after that you should receive the notifications.
Hmm..didn't seem to work for me. I want serverid, not _id, right? I did it for 3-4 folders and im not getting notifications after a reboot.
 

Thenetstriker

Senior Member
Jul 24, 2008
163
104
0
Hmm..didn't seem to work for me. I want serverid, not _id, right? I did it for 3-4 folders and im not getting notifications after a reboot.
Yes, you have to translate the serverId to base64. Which serverIds do you want to notify and how did you name your config files? Please also check if the following setting is set in the xml file and that its value is true:

Code:
<map>
  <boolean name="notification-enabled" value="true" />
<map>
Also check if the file permissions and the owner matches with the other files in this folder, or else the app does not have the permission to open them. You can also check the logcat output for errors. If e.g. a folder is excluded from the notification you would see the following log entry: Notifications are disabled for this folder; not notifying
 
  • Like
Reactions: phubarr

briangig

Senior Member
Sep 13, 2012
56
5
0
Yes, you have to translate the serverId to base64. Which serverIds do you want to notify and how did you name your config files? Please also check if the following setting is set in the xml file and that its value is true:

Code:
<map>
  <boolean name="notification-enabled" value="true" />
<map>
Also check if the file permissions and the owner matches with the other files in this folder, or else the app does not have the permission to open them. You can also check the logcat output for errors. If e.g. a folder is excluded from the notification you would see the following log entry: Notifications are disabled for this folder; not notifying
Thank you for the reply. I was able to translate to base64 for a folder. The serverid for the folder is 11, so the base 64 is MTE=. I then duplicated the file [email protected] and renamed the duplicate to [email protected]. I then rebooted, and was not getting notifications on that folder even after waiting for some time. I tried recreating my Exchange account, clearing cache, and I also checked the permissions on the xml files, they are the same as the origional *.xml.

Any thoughts?
 

Thenetstriker

Senior Member
Jul 24, 2008
163
104
0
Thank you for the reply. I was able to translate to base64 for a folder. The serverid for the folder is 11, so the base 64 is MTE=. I then duplicated the file [email protected] and renamed the duplicate to [email protected]. I then rebooted, and was not getting notifications on that folder even after waiting for some time. I tried recreating my Exchange account, clearing cache, and I also checked the permissions on the xml files, they are the same as the origional *.xml.

Any thoughts?
Can you please post the contents of the xml file here and check the output of logcat while the email is received? (You can filter the logs by tag "NotifUtils")
There is also another post with a better description here.
 
  • Like
Reactions: phubarr

briangig

Senior Member
Sep 13, 2012
56
5
0
Can you please post the contents of the xml file here and check the output of logcat while the email is received? (You can filter the logs by tag "NotifUtils")
There is also another post with a better description here.
Output of XML:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<map><boolean value="true" name="notifications-enabled"/><int value="3" name="prefs-version-number"/></map>

when sending a message to a folder:

https://s3.amazonaws.com/pushbullet...VyzYvacc5K/Screenshot_2013-12-05-10-04-54.png


Thank you!
 

Thenetstriker

Senior Member
Jul 24, 2008
163
104
0
Output of XML:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<map><boolean value="true" name="notifications-enabled"/><int value="3" name="prefs-version-number"/></map>

when sending a message to a folder:

https://s3.amazonaws.com/pushbullet...VyzYvacc5K/Screenshot_2013-12-05-10-04-54.png


Thank you!
The logs indicate that the notifications-enabled setting is not set (or not loaded) or set to false. The config filename should be correct but the contents of my config file is a bit different from yours, maybe this setting would work for you too:

Code:
<map>
<boolean name="notification-vibrate" value="false"/>
<boolean name="notifications-enabled" value="true"/>
<string name="notification-ringtone">content://settings/system/notification_sound</string>
<int name="prefs-version-number" value="3"/>
</map>
 
  • Like
Reactions: phubarr

briangig

Senior Member
Sep 13, 2012
56
5
0
The logs indicate that the notifications-enabled setting is not set (or not loaded) or set to false. The config filename should be correct but the contents of my config file is a bit different from yours, maybe this setting would work for you too:

Code:
<map>
<boolean name="notification-vibrate" value="false"/>
<boolean name="notifications-enabled" value="true"/>
<string name="notification-ringtone">content://settings/system/notification_sound</string>
<int name="prefs-version-number" value="3"/>
</map>
Didnt seem to do it, but im still playing around with it. What version of Email.apk are you on? I did notice I had to go to com.google.android.email, as opposed to com.android.email. I am on 6.0-920375.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone