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

Commit 808c3032 authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

refactor according to review

parent 37d63069
Loading
Loading
Loading
Loading
Loading
+0 −47
Original line number Diff line number Diff line
/*
 * Copyright MURENA SAS 2023
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package at.bitfire.davdroid.syncadapter

import android.accounts.Account
import android.content.ContentProviderClient
import android.content.Context
import android.content.SyncResult
import android.os.Bundle
import at.bitfire.davdroid.HttpClient
import at.bitfire.davdroid.db.AppDatabase

abstract class DummySyncAdapterService : SyncAdapterService() {

    override fun syncAdapter() = DummySyncAdapter(this, appDatabase)


    class DummySyncAdapter(
        context: Context,
        db: AppDatabase
    ) : SyncAdapter(context, db) {
        override fun sync(
            account: Account,
            extras: Bundle,
            authority: String,
            httpClient: Lazy<HttpClient>,
            provider: ContentProviderClient,
            syncResult: SyncResult
        ) {
            // Unused
        }
    }
}
+22 −1
Original line number Diff line number Diff line
@@ -16,4 +16,25 @@

package at.bitfire.davdroid.syncadapter

class EeloAppDataSyncAdapterService : DummySyncAdapterService()
 No newline at end of file
import android.accounts.Account
import android.content.ContentProviderClient
import android.content.SyncResult
import android.os.Bundle
import at.bitfire.davdroid.HttpClient

class EeloAppDataSyncAdapterService : SyncAdapterService() {

    override fun syncAdapter() =
        object : SyncAdapter(this@EeloAppDataSyncAdapterService, appDatabase) {
            override fun sync(
                account: Account,
                extras: Bundle,
                authority: String,
                httpClient: Lazy<HttpClient>,
                provider: ContentProviderClient,
                syncResult: SyncResult
            ) {
                // ignore
            }
        }
}
 No newline at end of file
+22 −1
Original line number Diff line number Diff line
@@ -16,4 +16,25 @@

package at.bitfire.davdroid.syncadapter

class EeloMediaSyncAdapterService : DummySyncAdapterService()
import android.accounts.Account
import android.content.ContentProviderClient
import android.content.SyncResult
import android.os.Bundle
import at.bitfire.davdroid.HttpClient

class EeloMediaSyncAdapterService : SyncAdapterService() {

    override fun syncAdapter() =
        object : SyncAdapter(this@EeloMediaSyncAdapterService, appDatabase) {
            override fun sync(
                account: Account,
                extras: Bundle,
                authority: String,
                httpClient: Lazy<HttpClient>,
                provider: ContentProviderClient,
                syncResult: SyncResult
            ) {
                // ignore
            }
        }
}
+22 −1
Original line number Diff line number Diff line
@@ -16,4 +16,25 @@

package at.bitfire.davdroid.syncadapter

class EeloMeteredEdriveSyncAdapterService : DummySyncAdapterService()
import android.accounts.Account
import android.content.ContentProviderClient
import android.content.SyncResult
import android.os.Bundle
import at.bitfire.davdroid.HttpClient

class EeloMeteredEdriveSyncAdapterService : SyncAdapterService() {

    override fun syncAdapter() =
        object : SyncAdapter(this@EeloMeteredEdriveSyncAdapterService, appDatabase) {
            override fun sync(
                account: Account,
                extras: Bundle,
                authority: String,
                httpClient: Lazy<HttpClient>,
                provider: ContentProviderClient,
                syncResult: SyncResult
            ) {
                // ignore
            }
        }
}
+22 −1
Original line number Diff line number Diff line
@@ -16,4 +16,25 @@

package at.bitfire.davdroid.syncadapter

class EeloNotesSyncAdapterService : DummySyncAdapterService()
 No newline at end of file
import android.accounts.Account
import android.content.ContentProviderClient
import android.content.SyncResult
import android.os.Bundle
import at.bitfire.davdroid.HttpClient

class EeloNotesSyncAdapterService : SyncAdapterService() {

    override fun syncAdapter() =
        object : SyncAdapter(this@EeloNotesSyncAdapterService, appDatabase) {
            override fun sync(
                account: Account,
                extras: Bundle,
                authority: String,
                httpClient: Lazy<HttpClient>,
                provider: ContentProviderClient,
                syncResult: SyncResult
            ) {
                // ignore
            }
        }
}
 No newline at end of file