<from AccountManager>
A1: Variable Set [ Name:%name To:mym...@gmail.com Do Maths:Off Append:Off ]
<from AccountManager or SyncAdapterType>
A2: Variable Set [ Name:%type To:com.google Do Maths:Off Append:Off ]
A3: Java Function [ Return:myaccount Class Or Object:Account Function:new
{Account} (String, String) Param:%name Param:%type Param: Param: Param: Continue Task After Error:On ]
<from SyncAdapterType - Mail>
A4: Variable Set [ Name:%auth To:gmail-ls Do Maths:Off Append:Off ]
<from SyncAdapterType - Calendar>
A5: [X] Variable Set [ Name:%auth To:com.android.calendar Do Maths:Off Append:Off ]
<from SyncAdapterType - Contacts>
A6: [X] Variable Set [ Name:%auth To:com.android.contacts Do Maths:Off Append:Off ]
<This makes sure the item is visible in accounts (don't set this to 0)>
A7: Java Function [ Return:%sync Class Or Object:ContentResolver Function:setIsSyncable
{} (Account, String, int) Param:myaccount Param:%auth Param:1 Param: Param: Continue Task After Error:On ]
<Enable>
A8: Java Function [ Return:%sync Class Or Object:ContentResolver Function:setSyncAutomatically
{} (Account, String, boolean) Param:myaccount Param:%auth Param:true Param: Param: Continue Task After Error:On ]
A1: Java Function [ Return:%sat Class Or Object:ContentResolver Function:getSyncAdapterTypes
{SyncAdapterType[]} () Param: Param: Param: Param: Param: Continue Task After Error:On ]
A2: Flash [ Text:%sat(#) %sat() Long:Off ]
Ok, well I think I got it working, though I'm not sure, and this probably isn't the most efficient way to do it. I created a profile with a time and power(on a.c.) context. I then made an enter task (sync on) and exit task (sync off). The sync on task was several nested tasks: WiFi on, sync contacts on, sync calendar on. The latter 2 tasks were modified versions of your java tasks. Similarly, the exit task was sync contacts off, sync calendar off, WiFi off. I'd like to export the whole routine for others to check/use, but when I try to export the profile it looks like it refers to my tasks (rather than showing the actions that the tasks perform), so isn't of much use. Thanks for all the help so far, this is an interesting learning experience for a non-programmer. And now that I think about it, I might as well take the time context out of it, and just have it sync on ac power...
Name (in Accounts) | %auth to use | userVisible |
Gmail | gmail-ls | 1 |
Calendar | com.android.calendar | 1 |
Contacts | com.android.contacts | 1 |
Keep | com.google.android.keep | 1 |
Google Play Music | com.google.android.music.MusicContent | 1 |
Google Play Movies & TV | com.google.android.videos.sync | 1 |
Google Play Newsstand | com.google.android.apps.magazines | 1 |
Google Play Books | com.google.android.apps.books | 1 |
Drive | com.google.android.apps.docs | 1 |
Docs | com.google.android.apps.docs.editors.kix | 1 |
Sheets | com.google.android.apps.docs.editors.trix | 1 |
Chrome Beta | com.chrome.beta | 1 |
People Details | com.google.android.gms.people | 1 |
App Data | com.google.android.gms.appstate | 1 |
Google+ | com.google.android.apps.plus.content.EsProvider | 1 |
Google+ Uploads | com.google.android.apps.plus.iu.EsGoogleIuProvider | 1 |
Google+ Photos | com.google.android.apps.photos.GooglePhotoDownsyncProvider | 1 |
Google Photos Auto Backup | com.google.android.gms.photos.iu.EsGoogleIuProvider | 1 |
Google Fit data | com.google.android.gms.fitness | 1 |
Sound Search for Google | com.google.android.ears.heard.EarsContentProvider | 1 |
News & Weather | com.google.android.apps.genie.geniewidget | 1 |
com.google.android.gms.plus.action | 0 | |
com.google.android.gms.reminders | 0 | |
com.google.android.gms.games.background | 0 | |
com.google.android.apps.cloudprint.cloudprintprovider | 0 | |
subscribedfeeds | 0 | |
com.google.android.gms.drive.sync | 0 | |
com.google.android.location.reporting | 0 | |
com.google.android.gms.auth.confirm | 0 | |
com.google.android.gms.games | 0 | |
com.google.android.gms.kids.timeouts | 0 |
Here the list of Google services on my phone, you can use the value of the %auth column (only when userVisible is 1)..
...