Skip to content

Commit d9a0044

Browse files
Merge pull request #1281 from session-foundation/release/1.25.2
Prepare for release 1.25.2
2 parents a2cd848 + 61a99ba commit d9a0044

File tree

6 files changed

+18
-20
lines changed

6 files changed

+18
-20
lines changed

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ configurations.configureEach {
2424
exclude(module = "commons-logging")
2525
}
2626

27-
val canonicalVersionCode = 413
28-
val canonicalVersionName = "1.25.1"
27+
val canonicalVersionCode = 414
28+
val canonicalVersionName = "1.25.2"
2929

3030
val postFixSize = 10
3131
val abiPostFix = mapOf(

app/src/main/java/org/thoughtcrime/securesms/ScreenLockActionBarActivity.kt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import android.os.Bundle
1010
import androidx.annotation.IdRes
1111
import androidx.core.content.ContextCompat
1212
import androidx.core.content.FileProvider
13+
import androidx.core.content.IntentCompat
1314
import androidx.fragment.app.Fragment
1415
import androidx.lifecycle.lifecycleScope
1516
import kotlinx.coroutines.Dispatchers
@@ -226,15 +227,17 @@ abstract class ScreenLockActionBarActivity : BaseActionBarActivity() {
226227

227228
// Clear original clipData
228229
rewrittenIntent.clipData = null
229-
230-
// If we couldn't find one then we have nothing to re-write and we'll just return the original intent
231-
if (!rewrittenIntent.hasExtra(Intent.EXTRA_STREAM)) {
232-
Log.i(TAG, "No stream to rewrite - returning original intent")
233-
return@withContext originalIntent
234-
}
230+
rewrittenIntent.removeExtra(Intent.EXTRA_STREAM)
235231

236232
// Grab and rewrite the original intent's clipData - adding it to our rewrittenIntent as we go
237233
val originalClipData = originalIntent.clipData
234+
?: IntentCompat.getParcelableExtra(originalIntent, Intent.EXTRA_STREAM, Uri::class.java)?.let { uri ->
235+
// If the original intent has a single Uri in the Intent.EXTRA_STREAM extra, we create a ClipData
236+
// with that Uri to mimic the original clipData structure.
237+
ClipData.newUri(contentResolver, "Shared data", uri)
238+
}
239+
240+
238241
originalClipData?.let { clipData ->
239242
var newClipData: ClipData? = null
240243
for (i in 0 until clipData.itemCount) {
@@ -267,10 +270,6 @@ abstract class ScreenLockActionBarActivity : BaseActionBarActivity() {
267270
Log.i(TAG, "Adding newClipData to rewrittenIntent.")
268271
rewrittenIntent.clipData = newClipData
269272
rewrittenIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
270-
} else {
271-
// If no newClipData was created, clear it to prevent referencing the old inaccessible URIs
272-
Log.i(TAG, "There was no newClipData - setting the clipData to null.")
273-
rewrittenIntent.clipData = null
274273
}
275274
}
276275

app/src/main/java/org/thoughtcrime/securesms/audio/AudioRecorder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ fun recordAudio(
125125

126126
try {
127127
val file by lazy {
128-
File.createTempFile("audio_recording_", ".m4a", context.cacheDir)
128+
File.createTempFile("audio_recording_", ".aac", context.cacheDir)
129129
}
130130

131131
recorder.setAudioSource(MediaRecorder.AudioSource.MIC)
132132
recorder.setAudioChannels(1)
133133
recorder.setAudioSamplingRate(44100)
134134
recorder.setAudioEncodingBitRate(32000)
135-
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)
135+
recorder.setOutputFormat(MediaRecorder.OutputFormat.AAC_ADTS)
136136
recorder.setOutputFile(file)
137137
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC)
138138
recorder.setOnErrorListener { _, what, extra ->

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VoiceMessageView.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import android.graphics.Canvas
55
import android.util.AttributeSet
66
import android.widget.RelativeLayout
77
import androidx.core.view.isVisible
8+
import androidx.media3.common.C
89
import dagger.hilt.android.AndroidEntryPoint
910
import network.loki.messenger.R
1011
import network.loki.messenger.databinding.ViewVoiceMessageBinding
@@ -78,7 +79,9 @@ class VoiceMessageView @JvmOverloads constructor(
7879

7980
override fun onPlayerStart(player: AudioSlidePlayer) {
8081
isPlaying = true
81-
durationMS = player.duration
82+
if (player.duration != C.TIME_UNSET) {
83+
durationMS = player.duration
84+
}
8285
}
8386

8487
override fun onPlayerStop(player: AudioSlidePlayer) { isPlaying = false }

app/src/main/java/org/thoughtcrime/securesms/database/AttachmentDatabase.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ public class AttachmentDatabase extends Database {
134134
CAPTION, STICKER_PACK_ID, STICKER_PACK_KEY, STICKER_ID, URL,
135135
AUDIO_DURATION};
136136

137-
private static final String[] PROJECTION_AUDIO_EXTRAS = new String[] {AUDIO_VISUAL_SAMPLES};
138-
139137
public static final String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " (" + ROW_ID + " INTEGER PRIMARY KEY, " +
140138
MMS_ID + " INTEGER, " + "seq" + " INTEGER DEFAULT 0, " +
141139
CONTENT_TYPE + " TEXT, " + NAME + " TEXT, " + "chset" + " INTEGER, " +
@@ -848,7 +846,7 @@ protected void updateAttachmentThumbnail(AttachmentId attachmentId, InputStream
848846
try (Cursor cursor = getReadableDatabase()
849847
// We expect all the audio extra values to be present (not null) or reject the whole record.
850848
.query(TABLE_NAME,
851-
PROJECTION_AUDIO_EXTRAS,
849+
new String[] {AUDIO_VISUAL_SAMPLES, AUDIO_DURATION},
852850
PART_ID_WHERE +
853851
" AND " + AUDIO_VISUAL_SAMPLES + " IS NOT NULL" +
854852
" AND " + AUDIO_DURATION + " IS NOT NULL" +

app/src/main/java/org/thoughtcrime/securesms/util/FilenameUtils.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ object FilenameUtils {
8484
@JvmStatic
8585
@JvmOverloads // Force creation of two versions of this method - one with and one without the mimeType param
8686
fun getFilenameFromUri(context: Context, uri: Uri?, mimeType: String? = null, attachment: Attachment? = null): String {
87-
Exception().printStackTrace()
88-
8987
var extractedFilename: String? = null
9088

9189
if (uri != null) {

0 commit comments

Comments
 (0)