Commit 6a512e1f authored by Ricki Hirner's avatar Ricki Hirner

Fix crash on single-core devices and ProGuard rules

parent 43009541
Pipeline #42485327 passed with stages
in 10 minutes and 16 seconds
......@@ -67,7 +67,6 @@ android {
dependencies {
implementation project(':cert4android')
implementation ':dav4jvm'
implementation project(':ical4android')
implementation project(':vcard4android')
......@@ -79,6 +78,9 @@ dependencies {
implementation 'androidx.preference:preference:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation(':dav4jvm') {
exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser
}
implementation 'com.jaredrummler:colorpicker:1.0.5'
implementation 'com.mikepenz:aboutlibraries:6.2.0'
......
......@@ -67,8 +67,10 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L
companion object {
val MAX_PROCESSING_THREADS = Math.min(Runtime.getRuntime().availableProcessors()/2, 1)
val MAX_DOWNLOAD_THREADS = Math.max(Runtime.getRuntime().availableProcessors(), 2)
val MAX_PROCESSING_THREADS = // nCPU/2 (rounded up for case of 1 CPU), but max. 4
Math.min((Runtime.getRuntime().availableProcessors()+1)/2, 4)
val MAX_DOWNLOAD_THREADS = // one (if one CPU), 2 otherwise
Math.min(Runtime.getRuntime().availableProcessors(), 2)
const val MAX_MULTIGET_RESOURCES = 10
fun cancelNotifications(manager: NotificationManagerCompat, authority: String, account: Account) =
......@@ -79,6 +81,10 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L
}
init {
Logger.log.info("SyncManager: using up to $MAX_PROCESSING_THREADS processing threads and $MAX_DOWNLOAD_THREADS download threads")
}
private val mainAccount = if (localCollection is LocalAddressBook)
localCollection.mainAccount
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment