Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fixes crash when searching in call history ([#378])

## [1.5.0] - 2025-06-06

### Added
Expand Down Expand Up @@ -179,3 +183,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#347]: https://github.com/FossifyOrg/Phone/issues/347
[#357]: https://github.com/FossifyOrg/Phone/issues/357
[#359]: https://github.com/FossifyOrg/Phone/issues/359
[#378]: https://github.com/FossifyOrg/Phone/issues/378
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ class CallActivity : SimpleActivity() {
audioRouteChooserDialog?.dismissAllowingStateLoss()

if (isCallEnded) {
finishAndRemoveTask()
safeFinishAndRemoveTask()
return
}

Expand All @@ -776,7 +776,7 @@ class CallActivity : SimpleActivity() {
@SuppressLint("SetTextI18n")
binding.callStatusLabel.text = "${callDuration.getFormattedDuration()} (${getString(R.string.call_ended)})"
Handler(mainLooper).postDelayed(3000) {
finishAndRemoveTask()
safeFinishAndRemoveTask()
}
} else {
disableAllActionButtons()
Expand All @@ -786,6 +786,18 @@ class CallActivity : SimpleActivity() {
}
}

private fun safeFinishAndRemoveTask() {
try {
if (intent != null) {
finishAndRemoveTask()
} else {
finish()
}
} catch (_: Exception) {
finish()
}
}

private val callCallback = object : CallManagerListener {
override fun onStateChanged() {
updateState()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.fossify.phone.models

import org.fossify.commons.helpers.DAY_SECONDS

sealed class CallLogItem {
data class Date(
val timestamp: Long,
Expand All @@ -8,7 +10,7 @@ sealed class CallLogItem {

fun getItemId(): Int {
return when (this) {
is Date -> dayCode.hashCode()
is Date -> -(timestamp / (DAY_SECONDS * 1000L)).toInt()
is RecentCall -> id
}
}
Expand Down
Loading