Skip to content

Commit

Permalink
Merge pull request #493 from Nailik/hotfix/492-noclassdef-javaniofile…
Browse files Browse the repository at this point in the history
…paths

fixed possible crash on Andorid 6
  • Loading branch information
github-actions[bot] committed Aug 21, 2023
2 parents eca1018 + c85de3d commit e527d16
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Version.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ object Version {

const val major = 0
const val minor = 5
const val patch = 4
const val code = 139
const val patch = 5
const val code = 140

override fun toString(): String {
return "$major.$minor.$patch-$code"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,9 @@ internal actual class AudioRecorder : IAudioRecorder, KoinComponent {
logger.v { "pauseRecording ${recorder?.recordingState}" }
_isRecording.value = false
try {
if (recorder?.recordingState == RECORDSTATE_RECORDING) {
recorder?.stop()
}
recorder?.stop()
} catch (e: Exception) {
logger.a(e) { "pauseRecording" }
logger.e(e) { "pauseRecording" }
}
}

Expand All @@ -180,11 +178,9 @@ internal actual class AudioRecorder : IAudioRecorder, KoinComponent {
if (_isRecording.value) {
_isRecording.value = false
try {
if (recorder?.recordingState == RECORDSTATE_RECORDING) {
recorder?.stop()
}
recorder?.stop()
} catch (e: Exception) {
logger.a(e) { "pauseRecording" }
logger.e(e) { "pauseRecording" }
}
//without release audio output sometimes doesn't work after calling start
recorder?.release()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ actual fun Path.commonDelete() {

actual fun Path.commonSize(): Long? = FileSystem.SYSTEM.metadata(this).size

actual fun Path.commonSource(): Source = this.toNioPath().source()
actual fun Path.commonSource(): Source = this.toFile().source()

actual fun Path.commonReadWrite(): FileHandle = FileSystem.SYSTEM.openReadWrite(this, !FileSystem.SYSTEM.exists(this))

Expand Down
2 changes: 1 addition & 1 deletion resources/src/commonMain/resources/MR/files/changelog.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[
"fix Audio Recorder crash"
"fixed possible crash on Android 6"
]

0 comments on commit e527d16

Please sign in to comment.