mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +01:00
put file length value in utils
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
ce8c4b2b84
commit
2478aa884b
@ -13,6 +13,7 @@ import android.media.MediaRecorder
|
||||
import android.util.Log
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.models.domain.ConversationModel
|
||||
import com.nextcloud.talk.utils.FileUtils
|
||||
import java.io.IOException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
@ -149,8 +150,8 @@ class MediaRecorderManager : LifecycleAwareManager {
|
||||
date,
|
||||
validDisplayName
|
||||
)
|
||||
if (fileNameWithoutSuffix.length > 146) {
|
||||
fileNameWithoutSuffix = fileNameWithoutSuffix.substring(0, 146)
|
||||
if (fileNameWithoutSuffix.length > FileUtils.FILE_MAX_LENGTH) {
|
||||
fileNameWithoutSuffix = fileNameWithoutSuffix.substring(0, FileUtils.FILE_MAX_LENGTH)
|
||||
}
|
||||
val fileName = fileNameWithoutSuffix + VOICE_MESSAGE_FILE_SUFFIX
|
||||
currentVoiceRecordFile = "${context.cacheDir.absolutePath}/$fileName"
|
||||
|
@ -27,6 +27,7 @@ object FileUtils {
|
||||
private val TAG = FileUtils::class.java.simpleName
|
||||
private const val RADIX: Int = 16
|
||||
private const val MD5_LENGTH: Int = 32
|
||||
const val FILE_MAX_LENGTH = 146
|
||||
|
||||
/**
|
||||
* Creates a new [File]
|
||||
|
Loading…
Reference in New Issue
Block a user