Skip to content
Snippets Groups Projects
Commit 823e875b authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Remove useless permission asking for the crash reporter

Fixes #2130
parent dce8ece1
No related branches found
No related tags found
1 merge request!1059Beta fixes
Pipeline #124807 passed with stage
in 2 minutes and 37 seconds
......@@ -51,7 +51,6 @@ import org.videolan.vlc.BuildConfig
import org.videolan.vlc.DebugLogService
import org.videolan.vlc.R
import org.videolan.vlc.databinding.SendCrashActivityBinding
import org.videolan.vlc.gui.helpers.hf.StoragePermissionsDelegate.Companion.getStoragePermission
import org.videolan.vlc.util.FileUtils
import org.videolan.vlc.util.Permissions
import java.io.File
......@@ -117,21 +116,19 @@ class SendCrashActivity : AppCompatActivity(), DebugLogService.Client.Callback {
//get medialib db if needed
val attachments = ArrayList<Uri>()
if (binding.includeMedialibSwitch.isChecked) {
if (getStoragePermission(true)) {
if (!::dbPath.isInitialized) {
val path = AppContextProvider.appContext.getExternalFilesDir(null)?.absolutePath
?: return@withContext null
dbPath = "$path/${Medialibrary.VLC_MEDIA_DB_NAME}"
dbZipPath = "$path/db.zip"
}
val db = File(getDir("db", Context.MODE_PRIVATE).toString() + Medialibrary.VLC_MEDIA_DB_NAME)
val dbFile = File(dbPath)
FileUtils.copyFile(db, dbFile)
FileUtils.zip(arrayOf(dbPath), dbZipPath)
FileUtils.deleteFile(dbFile)
attachments.add(FileProvider.getUriForFile(this@SendCrashActivity, applicationContext.packageName + ".provider", File(dbZipPath)))
if (!::dbPath.isInitialized) {
val path = AppContextProvider.appContext.getExternalFilesDir(null)?.absolutePath
?: return@withContext null
dbPath = "$path/${Medialibrary.VLC_MEDIA_DB_NAME}"
dbZipPath = "$path/db.zip"
}
val db = File(getDir("db", Context.MODE_PRIVATE).toString() + Medialibrary.VLC_MEDIA_DB_NAME)
val dbFile = File(dbPath)
FileUtils.copyFile(db, dbFile)
FileUtils.zip(arrayOf(dbPath), dbZipPath)
FileUtils.deleteFile(dbFile)
attachments.add(FileProvider.getUriForFile(this@SendCrashActivity, applicationContext.packageName + ".provider", File(dbZipPath)))
}
val appData = StringBuilder()
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment