Temporary disable sync for release builds
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<bool name="leak_canary_add_launcher_icon" tools:node="replace">false</bool>
|
||||
</resources>
|
||||
<bool name="is_sync_enabled">true</bool>
|
||||
</resources>
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.ContentProviderClient
|
||||
import android.content.Context
|
||||
import android.content.SyncResult
|
||||
import android.os.Bundle
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.sync.domain.SyncController
|
||||
import org.koitharu.kotatsu.sync.domain.SyncHelper
|
||||
import org.koitharu.kotatsu.utils.ext.onError
|
||||
@@ -20,6 +21,9 @@ class FavouritesSyncAdapter(context: Context) : AbstractThreadedSyncAdapter(cont
|
||||
provider: ContentProviderClient,
|
||||
syncResult: SyncResult,
|
||||
) {
|
||||
if (!context.resources.getBoolean(R.bool.is_sync_enabled)) {
|
||||
return
|
||||
}
|
||||
val syncHelper = SyncHelper(context, account, provider)
|
||||
runCatchingCancellable {
|
||||
syncHelper.syncFavourites(syncResult)
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.ContentProviderClient
|
||||
import android.content.Context
|
||||
import android.content.SyncResult
|
||||
import android.os.Bundle
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.sync.domain.SyncController
|
||||
import org.koitharu.kotatsu.sync.domain.SyncHelper
|
||||
import org.koitharu.kotatsu.utils.ext.onError
|
||||
@@ -20,6 +21,9 @@ class HistorySyncAdapter(context: Context) : AbstractThreadedSyncAdapter(context
|
||||
provider: ContentProviderClient,
|
||||
syncResult: SyncResult,
|
||||
) {
|
||||
if (!context.resources.getBoolean(R.bool.is_sync_enabled)) {
|
||||
return
|
||||
}
|
||||
val syncHelper = SyncHelper(context, account, provider)
|
||||
runCatchingCancellable {
|
||||
syncHelper.syncHistory(syncResult)
|
||||
|
||||
@@ -5,4 +5,5 @@
|
||||
<bool name="light_navigation_bar">false</bool>
|
||||
<bool name="com_samsung_android_icon_container_has_icon_container">true</bool>
|
||||
<bool name="is_color_themes_available">false</bool>
|
||||
<bool name="is_sync_enabled">false</bool>
|
||||
</resources>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<Preference
|
||||
android:enabled="@bool/is_sync_enabled"
|
||||
android:key="sync"
|
||||
android:persistent="false"
|
||||
android:summary="@string/sync_title"
|
||||
|
||||
Reference in New Issue
Block a user