Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a749a9fd authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Rename "debug model" (artifact from search/replace) to "debug info" again

parent 69513979
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ class DebugInfoActivity: AppCompatActivity() {
    fun onShare(item: MenuItem) {
        model.report.value?.let { report ->
            val builder = ShareCompat.IntentBuilder.from(this)
                    .setSubject("${getString(R.string.app_name)} ${BuildConfig.VERSION_NAME} debug model")
                    .setSubject("${getString(R.string.app_name)} ${BuildConfig.VERSION_NAME} debug info")
                    .setType("text/plain")

            try {
@@ -95,8 +95,8 @@ class DebugInfoActivity: AppCompatActivity() {
                if (!(debugInfoDir.exists() && debugInfoDir.isDirectory) && !debugInfoDir.mkdir())
                    throw IOException("Couldn't create debug directory")

                val reportFile = File(debugInfoDir, "davx5-model.txt")
                Logger.log.fine("Writing debug model to ${reportFile.absolutePath}")
                val reportFile = File(debugInfoDir, "davx5-info.txt")
                Logger.log.fine("Writing debug info to ${reportFile.absolutePath}")
                val writer = FileWriter(reportFile)
                writer.write(report)
                writer.close()
@@ -105,7 +105,7 @@ class DebugInfoActivity: AppCompatActivity() {
                builder.intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_ACTIVITY_NEW_TASK)
            } catch(e: IOException) {
                // creating an attachment failed, so send it inline
                val text = "Couldn't create debug model file: " + Log.getStackTraceString(e) + "\n\n$report"
                val text = "Couldn't create debug info file: " + Log.getStackTraceString(e) + "\n\n$report"
                builder.setText(text)
            }

@@ -123,7 +123,7 @@ class DebugInfoActivity: AppCompatActivity() {
            if (initialized)
                return

            Logger.log.info("Generating debug model report")
            Logger.log.info("Generating debug info report")
            initialized = true

            thread {
@@ -176,15 +176,15 @@ class DebugInfoActivity: AppCompatActivity() {
                try {
                    text.append("\nSOFTWARE INFORMATION\n")
                    val pm = context.packageManager
                    val appIDs = mutableSetOf(      // we always want model about these packages
                    val appIDs = mutableSetOf(      // we always want info about these packages
                            BuildConfig.APPLICATION_ID,                     // DAVx5
                            "${BuildConfig.APPLICATION_ID}.jbworkaround",   // DAVdroid JB Workaround
                            "org.dmfs.tasks"                               // OpenTasks
                    )
                    // add model about contact, calendar, task provider
                    // add info about contact, calendar, task provider
                    for (authority in arrayOf(ContactsContract.AUTHORITY, CalendarContract.AUTHORITY, TaskProvider.ProviderName.OpenTasks.authority))
                        pm.resolveContentProvider(authority, 0)?.let { appIDs += it.packageName }
                    // add model about available contact, calendar, task apps
                    // add info about available contact, calendar, task apps
                    for (uri in arrayOf(ContactsContract.Contacts.CONTENT_URI, CalendarContract.Events.CONTENT_URI, TaskContract.Tasks.getContentUri(TaskProvider.ProviderName.OpenTasks.authority))) {
                        val viewIntent = Intent(Intent.ACTION_VIEW, ContentUris.withAppendedId(uri, 1))
                        for (info in pm.queryIntentActivities(viewIntent, 0))