Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18565b7f authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

Add element to let user enable or disable edrive synchronization on metered network

- Add authority for eDrive new provider in strings.xml
- add eelo_sync_metered_edrive.xml in res/xml to add the sync-adapter option
- Update accountmanager/ui/setup/AccountDetailsFragment.kt to add code for the new option
parent 5575add1
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -296,6 +296,11 @@ class AccountDetailsFragment : Fragment() {
                    context.getString(R.string.app_data_authority),
                    true
                )
                ContentResolver.setSyncAutomatically(
                        account,
                        context.getString(R.string.metered_edrive_authority),
                        true
                )

                // add entries for account to service DB
                Logger.log.log(Level.INFO, "Writing account configuration to database", config)
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
    <string name="email_authority">foundation.e.mail.provider.AppContentProvider</string>
    <string name="media_authority">foundation.e.drive.providers.MediasSyncProvider</string>
    <string name="app_data_authority">foundation.e.drive.providers.SettingsSyncProvider</string>
    <string name="metered_edrive_authority">foundation.e.drive.providers.MeteredConnectionAllowedProvider</string>
    <string name="e_drive_package_name">foundation.e.drive</string>
    <string name="manage_accounts" translatable="false">Account extra settings</string>
    <string name="manage_account_description">Credentials, sync frequency, etc.</string>
+14 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (c) 2013 – 2015 Ricki Hirner (bitfire web engineering).
  ~ All rights reserved. This program and the accompanying materials
  ~ are made available under the terms of the GNU Public License v3.0
  ~ which accompanies this distribution, and is available at
  ~ http://www.gnu.org/licenses/gpl.html
  -->

<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="@string/eelo_account_type"
    android:contentAuthority="@string/metered_edrive_authority"
    android:isAlwaysSyncable="true"
    android:userVisible="true" />