sync issue in xiaomi



  • steps:

    1. installed davdroid from f-droid.
    2. apps - permission --> all granted
    3. added my account: url, username, password
    4. verified account has been added
    5. added all contacts/calendars to sync
    6. connected over my vpn with openvpn
    7. enabled miui sync button
    8. pushed “sync now”, just to force)
    9. google & aCalDav sync, DavDroid not. Even after hours…

    log is in the first post.

    debug info (“ip” is my numerical ip, “my_username” is my name):

    SOFTWARE INFORMATION
    DAVdroid version: 1.2.3-ose (112) Fri Aug 12 08:14:08 CEST 2016
    Installed from: org.fdroid.fdroid
    JB Workaround installed: no
    
    CONFIGURATION
    System-wide synchronization: manually
    Account: my_username.owncloud
    Address book sync. interval: 240 min
    Calendar sync. interval: 240 min
    OpenTasks sync. interval: —
    WiFi only: false
    [CardDAV] Contact group method: GROUP_VCARDS
    RFC 6868 encoding: true
    [CalDAV] Time range (past days): 90
    Manage calendar colors: true
    
    SQLITE DUMP
    android_metadata
    | locale |
    | it_IT |
    ----------
    settings
    | setting | value |
    | hint_OpenTasksNotInstalled | 0 |
    | logToExternalStorage | 1 |
    ----------
    services
    | _id | accountName | service | principal |
    | 1 | my_username.owncloud | carddav | https://ip/remote.php/dav/principals/users/my_username/ |
    | 2 | my_username.owncloud | caldav | https://ip/remote.php/dav/principals/users/my_username/ |
    ----------
    sqlite_sequence
    | name | seq |
    | services | 2 |
    | homesets | 3 |
    | collections | 7 |
    ----------
    homesets
    | _id | serviceID | url |
    | 1 | 2 | https://ip/remote.php/dav/calendars/my_username/ |
    | 3 | 1 | https://ip/remote.php/dav/addressbooks/users/my_username/ |
    ----------
    collections
    | _id | serviceID | url | readOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | sync |
    | 1 | 2 | https://ip/remote.php/dav/calendars/my_username/contact_birthdays/ | 1 | Contact birthdays | <null> | -54 | <null> | 1 | 1 | 1 |
    | 2 | 2 | https://ip/remote.php/dav/calendars/my_username/i/ | 0 | i | i | -4989844 | <null> | 1 | 1 | 1 |
    | 3 | 2 | https://ip/remote.php/dav/calendars/my_username/d/ | 0 | d | d | -32944 | <null> | 1 | 1 | 1 |
    | 4 | 2 | https://ip/remote.php/dav/calendars/my_username/work/ | 0 | work | <null> | -8638004 | <null> | 1 | 1 | 1 |
    | 5 | 2 | https://ip/remote.php/dav/calendars/my_username/defaultcalendar/ | 0 | calendario | calendario | -6306073 | <null> | 1 | 1 | 1 |
    | 7 | 1 | https://ip/remote.php/dav/addressbooks/users/my_username/contacts/ | 0 | Contacts | <null> | <null> | <null> | <null> | <null> | 1 |
    ----------
    
    SYSTEM INFORMATION
    Android version: 5.1.1 (LMY47V)
    Device: Xiaomi Mi-4c (libra)
    

  • developer

    System-wide synchronization: manually

    Auto-sync is disabled for the whole system. Don’t know where the option is for your device. Often there’s a Sync on/off button in the top system bar, and it should be in Android Settings / Accounts / Synchronize data automatically or something like that.

    Please try with enabled sync for your device.



  • Of course. As you can read at step 7 of previous post I enabled the auto-sync android button. In fact everything syncs except DavDroid


  • developer

    @fastidio Then I don’t have any idea. Synchronization is not triggered by DAVdroid, but DAVdroid is only called by the system. What happens if you go into the DAVdroid account in Android settings / Accounts? Can you force synchronization there?

    Maybe some of Miui’s privacy settings, see no calendars visible, no bugs, no notifications?



  • I solved.
    DavDroid must be enabled as startup app under

    security>permissions>autostart


  • developer

    @fastidio Thanks for sharing your solution. (Whatever a “startup app” is; DAVdroid doesn’t require any autostart permissions because it’s launched by Android for synchronization.)



  • well, I understand… you should discuss it with miui developers…



  • Just want to confirm that enabling DavDroid as autostart app resolves this problem for me as well. Prior to doing so, I saw this in the adb logs. I don’t know if this is related though.

    E/SyncManager( 1056): Bind attempt failed - target: ComponentInfo{at.bitfire.davdroid/at.bitfire.davdroid.syncadapter.CalendarsSyncAdapterService}
    

  • developer

    I have created a new FAQ: How do I enable DAVdroid synchronization on Xiaomi MIUI?

    We do not have a MIUI device, so would it be possible that you post a screenshot of the Security / Permissions / Autostart activity so that we can add it to the FAQ article?



  • 0_1476463136730_Screenshot_2016-10-14-17-39-17-274_com.miui.securitycenter.png
    Open ‘Security’, select ‘Permissions’.
    0_1476463248358_Screenshot_2016-10-14-17-39-24-167_com.miui.securitycenter.png
    Select Autostart.
    0_1476463318076_Screenshot_2016-10-14-17-41-47-193_com.miui.securitycenter.png
    Toggle autostart on for desired app(s). I found that I needed to do the same thing with OpenTasks for tasks synchronization to work.

    Battery settings:
    0_1476463509209_copyScreenshot_2016-10-14-17-43-41-701_com.android.settings.png
    Swipe down from top of screen and select cog, search for battery, select ‘Manage apps battery usage’.
    0_1476463551379_Screenshot_2016-10-14-17-43-49-533_com.miui.powerkeeper.png
    Select ‘choose apps’
    0_1476463613566_Screenshot_2016-10-14-17-44-12-392_com.miui.powerkeeper.png
    Select desired app(s).
    0_1476463680398_Screenshot_2016-10-14-18-47-43-538_com.miui.powerkeeper.png
    And set ‘no restrictions’.


  • admin

    Thanks to a very nice person we met at Nextcloud conf 2017 we were able to personally take some important screenshots from a Xiaomi device and managed to find out what you need to do to get DAVdroid working with Xiaomi devices. Please have a look at these screenshots and on the colorized sections (stuff that belongs together is colored (orange, blue and pink) the same way).

    2_1504271485790_0.png
    1_1504271485790_1.png
    4_1504271485790_2.png
    0_1504271485790_3.png
    5_1504271485790_4.png
    9_1504271485790_5.png
    10_1504271485790_6.png
    8_1504271485790_7.png
    6_1504271485790_8.png
    3_1504271485790_9.png
    7_1504271485790_10.png

    Don’t forget to also remove your battery restrictions (if you want DAVdroid to sync automatically):

    2_1504272342564_a.png
    3_1504272342564_b.png
    1_1504272342564_c.png
    0_1504272342564_d.png


Log in to reply
 

Similar topics