Updated on 2026-08-14
This commit is contained in:
parent
a345df3c84
commit
f934e725b0
3 changed files with 17 additions and 6 deletions
|
|
@ -81,6 +81,17 @@
|
|||
</activity>
|
||||
|
||||
<activity android:name="com.tangem.tap.common.qrCodeScan.ScanQrCodeActivity" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths" />
|
||||
</provider>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -6,7 +6,6 @@ import android.content.Intent
|
|||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Environment
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.FileProvider
|
||||
import com.tangem.LogMessage
|
||||
|
|
@ -28,8 +27,6 @@ class FeedbackManager(
|
|||
private val email: String = "azhilenkov@tangem.com",
|
||||
) {
|
||||
|
||||
private val attachmentFileName = "feedbackEmailAttachment"
|
||||
|
||||
fun send(emailData: EmailData) {
|
||||
val fileLog = if (emailData is ScanFailsEmail) createLogFile() else null
|
||||
sendTo(email, emailData.subject, emailData.joinTogether(infoHolder), fileLog)
|
||||
|
|
@ -43,8 +40,7 @@ class FeedbackManager(
|
|||
putExtra(Intent.EXTRA_SUBJECT, subject)
|
||||
putExtra(Intent.EXTRA_TEXT, message)
|
||||
fileLog?.let {
|
||||
val authority = context.packageName + ".provider"
|
||||
val uri = FileProvider.getUriForFile(context, authority, it)
|
||||
val uri = FileProvider.getUriForFile(context, "${context.packageName}.provider", it)
|
||||
putExtra(Intent.EXTRA_STREAM, uri)
|
||||
}
|
||||
}
|
||||
|
|
@ -60,7 +56,7 @@ class FeedbackManager(
|
|||
|
||||
private fun createLogFile(): File? {
|
||||
return try {
|
||||
val file = File(Environment.getExternalStorageDirectory(), attachmentFileName)
|
||||
val file = File(context.filesDir, "logs.txt")
|
||||
file.delete()
|
||||
file.createNewFile()
|
||||
|
||||
|
|
|
|||
4
app/src/main/res/xml/provider_paths.xml
Normal file
4
app/src/main/res/xml/provider_paths.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<files-path name="files" path="/"/>
|
||||
</paths>
|
||||
Loading…
Add table
Add a link
Reference in a new issue