From 3d2c2d13017adcf8f96f585319eb3525c7cdd21a Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Fri, 1 Sep 2023 12:54:56 +0530 Subject: [PATCH] Exclude Content from uris With latest android while sharing screenshot it attaches content URI in file which message app was thinking as so send address , hence ignore content URI to fix the issue --- .../com/moez/QKSMS/feature/compose/ComposeActivityModule.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivityModule.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivityModule.kt index 8368dfa81..ea8f72ef2 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivityModule.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivityModule.kt @@ -18,8 +18,10 @@ */ package com.moez.QKSMS.feature.compose +import android.content.ContentResolver import android.content.Intent import android.net.Uri +import androidx.core.net.toUri import androidx.lifecycle.ViewModel import com.google.android.mms.ContentType import com.moez.QKSMS.injection.ViewModelKey @@ -107,6 +109,10 @@ class ComposeActivityModule { if (data?.contains('%') == true) { return URLDecoder.decode(data, "UTF-8") } + + if (ContentResolver.SCHEME_CONTENT.equals(data?.toUri()?.scheme)) { + return null + } return data } -- GitLab