Compare commits

...

2 Commits

Author SHA1 Message Date
Ricki Hirner
74c8caf452 Version bump to 2.6.6
New version code strategy:
  major * 100000000 +
  minor1 *  1000000 +
  minor2 *    10000 +
  patchlevel *  100 +
  release number,

e.g. 2.6.6 = 206060000
2020-04-14 15:22:26 +02:00
Ricki Hirner
363aac1c99 Don't cancel notifications of other sync threads (lets important notifications disappear sometimes) 2020-04-14 15:21:38 +02:00
9 changed files with 20 additions and 15 deletions

View File

@@ -19,7 +19,7 @@ android {
defaultConfig {
applicationId "at.bitfire.davdroid"
versionCode 334
versionCode 206060000
buildConfigField "long", "buildTime", System.currentTimeMillis() + "L"
buildConfigField "boolean", "customCerts", "true"
@@ -44,7 +44,7 @@ android {
flavorDimensions "distribution"
productFlavors {
standard {
versionName "2.6.5-ose"
versionName "2.6.6-ose"
}
}

View File

@@ -117,6 +117,9 @@ class LocalAddressBook(
}
override val tag: String
get() = "contacts-${account.name}"
override val title = account.name!!
/**

View File

@@ -85,6 +85,9 @@ class LocalCalendar private constructor(
}
}
override val tag: String
get() = "events-${account.name}-$id"
override val title: String
get() = displayName ?: id.toString()

View File

@@ -13,6 +13,9 @@ import at.bitfire.davdroid.model.SyncState
interface LocalCollection<out T: LocalResource<*>> {
/** a tag that uniquely identifies the collection (DAVx5-wide) */
val tag: String
/** collection title (used for user notifications etc.) **/
val title: String

View File

@@ -88,6 +88,9 @@ class LocalTaskList private constructor(
}
override val tag: String
get() = "tasks-${account.name}-$id"
override val title: String
get() = name ?: id.toString()

View File

@@ -118,7 +118,6 @@ abstract class SyncAdapterService: Service() {
// required for dav4jvm (ServiceLoader)
Thread.currentThread().contextClassLoader = context.classLoader
SyncManager.cancelNotifications(NotificationManagerCompat.from(context), authority, account)
sync(account, extras, authority, provider, syncResult)
} finally {
synchronized(runningSyncs) {

View File

@@ -77,12 +77,6 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L
min(Runtime.getRuntime().availableProcessors(), 2)
const val MAX_MULTIGET_RESOURCES = 10
fun cancelNotifications(manager: NotificationManagerCompat, authority: String, account: Account) =
manager.cancel(notificationTag(authority, account), NotificationUtils.NOTIFY_SYNC_ERROR)
private fun notificationTag(authority: String, account: Account) =
"$authority-${account.name}".hashCode().toString()
}
init {
@@ -95,7 +89,7 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L
account
protected val notificationManager = NotificationManagerCompat.from(context)
protected val notificationTag = notificationTag(authority, mainAccount)
protected val notificationTag = localCollection.tag
protected val httpClient = HttpClient.Builder(context, accountSettings).build()

View File

@@ -18,7 +18,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProviders
import androidx.lifecycle.ViewModelProvider
import at.bitfire.davdroid.R
import at.bitfire.davdroid.databinding.LoginCredentialsFragmentBinding
import at.bitfire.davdroid.model.Credentials
@@ -31,8 +31,8 @@ class DefaultLoginCredentialsFragment: Fragment() {
private lateinit var loginModel: LoginModel
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
model = ViewModelProviders.of(this).get(DefaultLoginCredentialsModel::class.java)
loginModel = ViewModelProviders.of(requireActivity()).get(LoginModel::class.java)
model = ViewModelProvider(this).get(DefaultLoginCredentialsModel::class.java)
loginModel = ViewModelProvider(requireActivity()).get(LoginModel::class.java)
val v = LoginCredentialsFragmentBinding.inflate(inflater, container, false)
v.lifecycleOwner = viewLifecycleOwner
@@ -52,7 +52,7 @@ class DefaultLoginCredentialsFragment: Fragment() {
v.login.setOnClickListener {
if (validate())
requireFragmentManager().beginTransaction()
parentFragmentManager.beginTransaction()
.replace(android.R.id.content, DetectConfigurationFragment(), null)
.addToBackStack(null)
.commit()

View File

@@ -76,7 +76,7 @@ class NextcloudLoginFlowFragment: Fragment() {
)
// continue to next fragment
requireFragmentManager().beginTransaction()
parentFragmentManager.beginTransaction()
.replace(android.R.id.content, DetectConfigurationFragment(), null)
.addToBackStack(null)
.commit()