Skip to content
Snippets Groups Projects
Commit e6ad25ed authored by Mohamed Metwalli's avatar Mohamed Metwalli
Browse files

Merge branch 'release/1.11.x' into feature/2950-home-screenshots

parents 1b7ad7e1 b1778621
No related branches found
No related tags found
No related merge requests found
Showing
with 15 additions and 26 deletions
......@@ -152,7 +152,7 @@ object DebugLogger : DebugLoggerBase() {
}
private fun appendLogLine(line: LogLine) {
val formattedLine = line.format(context)
val formattedLine = line.format()
runningLog.appendText(formattedLine, Charsets.UTF_8)
}
......
package de.rki.coronawarnapp.bugreporting.debuglog
import android.content.Context
import android.util.Log
import org.joda.time.Instant
......@@ -12,7 +11,7 @@ data class LogLine(
val throwable: Throwable?
) {
fun format(context: Context): String {
fun format(): String {
val time = Instant.ofEpochMilli(timestamp)
return "$time ${priorityLabel(priority)}/$tag: $message\n"
}
......
......@@ -24,7 +24,7 @@ class ContactDiaryLocationListViewModel @AssistedInject constructor(
@Assisted selectedDay: String,
private val contactDiaryRepository: ContactDiaryRepository
) : CWAViewModel(dispatcherProvider = dispatcherProvider) {
private val coroutineExceptionHandler = CoroutineExceptionHandler { coroutineContext, ex ->
private val coroutineExceptionHandler = CoroutineExceptionHandler { _, ex ->
ex.report(ExceptionCategory.INTERNAL, TAG)
}
......
......@@ -24,7 +24,7 @@ class ContactDiaryPersonListViewModel @AssistedInject constructor(
@Assisted selectedDay: String,
private val contactDiaryRepository: ContactDiaryRepository
) : CWAViewModel(dispatcherProvider = dispatcherProvider) {
private val coroutineExceptionHandler = CoroutineExceptionHandler { coroutineContext, ex ->
private val coroutineExceptionHandler = CoroutineExceptionHandler { _, ex ->
ex.report(ExceptionCategory.INTERNAL, TAG)
}
......
......@@ -19,7 +19,7 @@ class ContactDiaryEditLocationsViewModel @AssistedInject constructor(
private val contactDiaryRepository: ContactDiaryRepository,
dispatcherProvider: DispatcherProvider
) : CWAViewModel(dispatcherProvider = dispatcherProvider) {
private val coroutineExceptionHandler = CoroutineExceptionHandler { coroutineContext, ex ->
private val coroutineExceptionHandler = CoroutineExceptionHandler { _, ex ->
ex.report(ExceptionCategory.INTERNAL, TAG)
}
......
......@@ -31,7 +31,7 @@ class ContactDiaryEditPersonsViewModel @AssistedInject constructor(
val isListVisible = contactDiaryRepository.people.map { it.isNotEmpty() }
.asLiveData(dispatcherProvider.IO)
private val coroutineExceptionHandler = CoroutineExceptionHandler { coroutineContext, ex ->
private val coroutineExceptionHandler = CoroutineExceptionHandler { _, ex ->
ex.report(ExceptionCategory.INTERNAL, TAG)
}
......
......@@ -66,7 +66,7 @@ class ContactDiaryLocationBottomSheetDialogFragment : BottomSheetDialogFragment(
viewModel.textChanged(it.toString())
}
binding.contactDiaryLocationBottomSheetTextInputEditText.setOnEditorActionListener { v, actionId, event ->
binding.contactDiaryLocationBottomSheetTextInputEditText.setOnEditorActionListener { _, actionId, _ ->
return@setOnEditorActionListener when (actionId) {
EditorInfo.IME_ACTION_DONE -> {
if (viewModel.isValid.value == true) {
......@@ -90,10 +90,6 @@ class ContactDiaryLocationBottomSheetDialogFragment : BottomSheetDialogFragment(
}
}
override fun onPause() {
super.onPause()
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
......
......@@ -25,7 +25,7 @@ class ContactDiaryLocationBottomSheetDialogViewModel @AssistedInject constructor
@Assisted private val addedAt: String?,
private val contactDiaryRepository: ContactDiaryRepository
) : CWAViewModel(dispatcherProvider = dispatcherProvider) {
private val coroutineExceptionHandler = CoroutineExceptionHandler { coroutineContext, ex ->
private val coroutineExceptionHandler = CoroutineExceptionHandler { _, ex ->
shouldClose.postValue(null)
ex.report(ExceptionCategory.INTERNAL, TAG)
}
......
......@@ -66,7 +66,7 @@ class ContactDiaryPersonBottomSheetDialogFragment : BottomSheetDialogFragment(),
viewModel.textChanged(it.toString())
}
binding.contactDiaryPersonBottomSheetTextInputEditText.setOnEditorActionListener { v, actionId, event ->
binding.contactDiaryPersonBottomSheetTextInputEditText.setOnEditorActionListener { _, actionId, _ ->
return@setOnEditorActionListener when (actionId) {
IME_ACTION_DONE -> {
if (viewModel.isValid.value == true) {
......@@ -90,10 +90,6 @@ class ContactDiaryPersonBottomSheetDialogFragment : BottomSheetDialogFragment(),
}
}
override fun onPause() {
super.onPause()
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
......
......@@ -25,7 +25,7 @@ class ContactDiaryPersonBottomSheetDialogViewModel @AssistedInject constructor(
@Assisted private val addedAt: String?,
private val contactDiaryRepository: ContactDiaryRepository
) : CWAViewModel(dispatcherProvider = dispatcherProvider) {
private val coroutineExceptionHandler = CoroutineExceptionHandler { coroutineContext, ex ->
private val coroutineExceptionHandler = CoroutineExceptionHandler { _, ex ->
shouldClose.postValue(null)
ex.report(ExceptionCategory.INTERNAL, TAG)
}
......
......@@ -20,7 +20,7 @@ class TracingProgressCard(
}
override val onBindData: TracingContentProgressViewBinding.(item: Item, payloads: List<Any>) -> Unit =
{ item, payloads ->
{ item, _ ->
itemView.backgroundTintMode = PorterDuff.Mode.SRC_OVER
itemView.backgroundTintList = ColorStateList.valueOf(item.state.getContainerColor(context))
state = item.state
......
......@@ -35,7 +35,7 @@ class SettingsFragment : Fragment(R.layout.fragment_settings), AutoInject {
vm.notificationState.observe2(this) {
binding.notificationState = it
}
vm.backgroundPrioritystate.observe2(this) {
vm.backgroundPriorityState.observe2(this) {
binding.backgroundState = it
}
setButtonOnClickListener()
......
......@@ -25,7 +25,6 @@ class SettingsFragmentViewModel @AssistedInject constructor(
.map { it.toSettingsTracingState() }
.asLiveData(dispatcherProvider.Default)
// (settingsViewModel.isNotificationsEnabled(), settingsViewModel.isNotificationsRiskEnabled(), settingsViewModel.isNotificationsTestEnabled())}"
val notificationState: LiveData<SettingsNotificationState> = combine(
notificationSettings.isNotificationsEnabled,
notificationSettings.isNotificationsRiskEnabled,
......@@ -38,7 +37,7 @@ class SettingsFragmentViewModel @AssistedInject constructor(
)
}.asLiveData(dispatcherProvider.Default)
val backgroundPrioritystate: LiveData<SettingsBackgroundState> =
val backgroundPriorityState: LiveData<SettingsBackgroundState> =
backgroundModeStatus.isIgnoringBatteryOptimizations
.map { SettingsBackgroundState((it)) }
.asLiveData(dispatcherProvider.Default)
......
......@@ -79,8 +79,8 @@ class SettingsFragmentViewModelTest : BaseTest() {
@Test
fun `background priority status is forwarded`() {
createInstance().apply {
backgroundPrioritystate.observeForever { }
backgroundPrioritystate.value shouldBe SettingsBackgroundState(
backgroundPriorityState.observeForever { }
backgroundPriorityState.value shouldBe SettingsBackgroundState(
isEnabled = true
)
}
......
......@@ -13,7 +13,6 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.CoreMatchers.equalTo
import org.hamcrest.MatcherAssert.assertThat
import org.junit.After
import org.junit.Before
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment