FORUMS
Remove All Ads from XDA

[HOWTO] (Re)Enabling the Android Calendar sync

220 posts
Thanks Meter: 81
 
By feisty_noodle, Senior Member on 21st December 2010, 04:17 PM
Post Reply Email Thread
tldr: Although the initial calendar state is pulled from Google servers upon account setup, normal syncing function of the Calendar app is broken in the autonootered Nooks; follow this procedure to fix

------------------------------------------------------------

It seems, the problem is that there is no way to set the sync state of the google services because we don't have access to the proper Android Settings (just whatever B&N wants us to have).

There is, however an xml file which can set the properties, if properly edited:
/data/system/sync/accounts.xml

In this file, one can find a bunch of entries which correspond with registered Google accounts (made possible, of course, by the SetupWizard.apk provided as a result of the Autonooter procedure).

They (these entries) look like this:
Code:
<authority id="?" account="[email protected]" type="com.google" authority="???" />
Procedure to enable calendar syncing:

0) If possible, backup the current state with TitaniumBackup or something similar. (I haven't seen any bad mishaps -- like a /data wipe -- but one never knows.)

1) pull the /data/system/sync/accounts.xml and save a copy just in case
Code:
cmdline$ adb pull /data/system/sync/accounts.xml ./accounts.xml
cmdline$ adb pull /data/system/sync/accounts.xml ./accounts.xml.orig
2) modify the lines in accounts.xml with {authority="calendar"} to include {enabled="true" syncable="true"}; use a simple text editor not to introduce any weird formatting

The final state of the line will be something like this:
Code:
<authority id="?" account="[email protected]" type="com.google" authority="calendar" enabled="true" syncable="true" />
3) push the modified file back to the same location
Code:
cmdline$ adb push ./accounts.xml /data/system/sync/accounts.xml
4) reboot and test the syncing: create an event on the Nook and see it appear on GCal (should happen within 30 s), create an event on GCal and see it appear on the Nook (you may have to refresh the app by exiting to Home and getting back in, for example)

5) enjoy your functional calendar app

Note: although I have not experienced any weirdness, and this procedure appears to be safe, please remember that this is a hack.
That said, I have safely started B&N Shop and Nook Home app. Things are steady on my Nook.

Update: After a couple of days, things are stable. Events are still syncing; no spontaneous wipes.
Also, others have reported success, so I am unburying this post from a different thread.
The Following 6 Users Say Thank You to feisty_noodle For This Useful Post: [ View ] Gift feisty_noodle Ad-Free
 
 
21st December 2010, 05:56 PM |#2  
Senior Member
Salt Lake City, UT
Thanks Meter: 178
 
More
I've been using an app/widget called "Synker" available on the Market. Works good to trigger sync events, but maybe I'll try these steps this weekend when I get some downtime.

Thanks!
The Following User Says Thank You to jasoraso For This Useful Post: [ View ] Gift jasoraso Ad-Free
22nd December 2010, 04:10 PM |#3  
dawynkoop's Avatar
Senior Member
Flag Fort Wayne
Thanks Meter: 32
 
Donate to Me
More
Tried this, pushed the file to the device and the pulled it again to see if the proper file was there and it was, but after rebooting it restores back to the original file. Any way to prevent that from happening?
22nd December 2010, 07:02 PM |#4  
OP Senior Member
Thanks Meter: 81
 
More
Quote:
Originally Posted by dawynkoop

Tried this, pushed the file to the device and the pulled it again to see if the proper file was there and it was, but after rebooting it restores back to the original file. Any way to prevent that from happening?

Hmm, you are right; I see this, too.

I don't understand what is happening, but it is clear to me that the file gets refreshed with every reboot. Where is the data coming from? I don't know at this point. I didn't notice any data regarding sync management in accounts.db.

Nevertheless, the sync is persistent on my device. That is, after several reboots and no further meddling with the accounts.xml file (apart from the initial mod), I see sync behavior work, as expected.

One reason for this may be that the "enabled" and "syncable" switches for the primary account are NOT set to "false" after the reboot. They are simply discarded.

To answer your question directly, I suppose, one may change the write permissions on the accounts.xml file to read-only (at this time the permissions are 600) after modifications are applied. Haven't tested that yet ...
22nd December 2010, 07:07 PM |#5  
dawynkoop's Avatar
Senior Member
Flag Fort Wayne
Thanks Meter: 32
 
Donate to Me
More
I'll give that a shot. I also noticed that after I added the Android 3D gallery app it created a new entry in the accounts.xml fil for picasa.
25th December 2010, 02:13 AM |#6  
Mikey's Avatar
Retired Senior Moderator
Flag Wheaton, Il
Thanks Meter: 1,729
 
Donate to Me
More
So would, adb shell chmod 755 /data/system/sync/accounts.xml work for the write permissions on accounts.xml
25th December 2010, 04:06 AM |#7  
OP Senior Member
Thanks Meter: 81
 
More
Seeing that this file needs to be modified by the system from time to time (e.g. when adding new accounts), I would not mess with it. There is clearly something going on that is unaccounted for.

FYI: 755 stands for rwxr-xr-x, which is not read-only. On my device, the starting state is 600 or rw-------. Read-only (r--------) would be 'chmod 400'.

For my use, the hack still seems to work well. I cannot add and manage calendars from my other Google accounts, but I'll live with this.

Before this, I used the Synker widget mentioned above, but didn't like having to sync manually. I never remember to do that when I reconnect with the network after working offline. I need a system service to take care of that for me.

Once we have Froyo (fingers-crossed), all of this will be moot.
25th December 2010, 03:00 PM |#8  
dawynkoop's Avatar
Senior Member
Flag Fort Wayne
Thanks Meter: 32
 
Donate to Me
More
I was finlly able to get my calendar syncing by opening the GMail app selecting menu then accounts and then re-adding my gmail account, when I re-added the account it gave me the option to select calendar for syncing.

Sent from my ROOTED Barnes & Noble NookCOLOR
The Following 2 Users Say Thank You to dawynkoop For This Useful Post: [ View ] Gift dawynkoop Ad-Free
25th December 2010, 05:12 PM |#9  
OP Senior Member
Thanks Meter: 81
 
More
@dawynkoop That sounds about right. What you see is the foundation of the hack.
The problem is that there is no way to toggle this option, once set, is there?

I wish I knew where the settings really reside in the system.

Sent from my LogicPD Zoom2 using XDA App
25th December 2010, 06:35 PM |#10  
here.david's Avatar
Senior Member
Flag Sonoma, CA
Thanks Meter: 30
 
More
Quote:
Originally Posted by dawynkoop

I was finlly able to get my calendar syncing by opening the GMail app selecting menu then accounts and then re-adding my gmail account, when I re-added the account it gave me the option to select calendar for syncing.

Sent from my ROOTED Barnes & Noble NookCOLOR

YES SIR! worked, tx's....funny how it shows my account yet allows one to enter the same account again...was not sure if I was to remove the account 1st...just added it again w/o removing in case other were wondering...
The Following User Says Thank You to here.david For This Useful Post: [ View ] Gift here.david Ad-Free
26th December 2010, 10:35 AM |#11  
Junior Member
Flag Brooklyn
Thanks Meter: 0
 
More
Thank you. I was trying to figure out how to get this working for a couple hrs. In my haste to get this working I forgot to check the system sync.
Post Reply Subscribe to Thread

Tags
calendar, nook

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes