Skip to content

Commit ef1be86

Browse files
AchoArnoldCopilot
andauthored
Update android/app/src/main/java/com/httpsms/FirebaseMessagingService.kt
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 75459a1 commit ef1be86

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

android/app/src/main/java/com/httpsms/FirebaseMessagingService.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
299299
// Also clean up the MMS PDU file to avoid cache buildup in cases where
300300
// sendMultimediaMessage fails before the sent broadcast is delivered.
301301
try {
302-
val pduFile = File(applicationContext.cacheDir, "pdu_${message.id}.dat")
302+
// The PDU file is stored under the "mms_attachments" cache subdirectory;
303+
// delete it from the same location to ensure cleanup is effective.
304+
val pduDir = File(applicationContext.cacheDir, "mms_attachments")
305+
val pduFile = File(pduDir, "pdu_${message.id}.dat")
303306
if (pduFile.exists()) {
304307
val deleted = pduFile.delete()
305308
if (!deleted) {

0 commit comments

Comments
 (0)