Browse Source

Improve the feedback changed settings formatting

merge-requests/1594/merge
Nicolas Pomepuy 1 year ago
parent
commit
21f2acedfb
  1. 6
      application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/RemoteAccessRouting.kt
  2. 21
      application/vlc-android/src/org/videolan/vlc/DebugLogService.kt
  3. 6
      application/vlc-android/src/org/videolan/vlc/gui/helpers/FeedbackUtil.kt

6
application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/RemoteAccessRouting.kt

@ -370,9 +370,11 @@ fun Route.setupRouting(appContext: Context, scope: CoroutineScope) {
bw.write("Storage ALL access: ${Permissions.hasAllAccess(appContext)}\r\n")
bw.write("Notifications: ${Permissions.canSendNotifications(appContext)}\r\n")
bw.write("PiP Allowed: ${Permissions.isPiPAllowed(appContext)}\r\n")
bw.write("____________________________\r\n")
try {
bw.write("Changed settings:\r\n${PreferenceParser.getChangedPrefsString(appContext)}\r\n")
bw.write("____________________________\r\n")
bw.write("Changed settings:\r\n")
bw.write("____________________________\r\n")
bw.write("${PreferenceParser.getChangedPrefsString(appContext)}\r\n")
} catch (e: Exception) {
bw.write("Cannot retrieve changed settings\r\n")
bw.write(Log.getStackTraceString(e))

21
application/vlc-android/src/org/videolan/vlc/DebugLogService.kt

@ -28,7 +28,12 @@ import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.content.pm.ServiceInfo
import android.os.*
import android.os.Build
import android.os.Handler
import android.os.IBinder
import android.os.Looper
import android.os.RemoteCallbackList
import android.os.RemoteException
import android.text.format.DateFormat
import android.util.Log
import androidx.core.app.NotificationCompat
@ -46,8 +51,12 @@ import org.videolan.vlc.gui.DebugLogActivity
import org.videolan.vlc.gui.helpers.NotificationHelper
import org.videolan.vlc.gui.preferences.search.PreferenceParser
import org.videolan.vlc.util.Permissions
import java.io.*
import java.util.*
import java.io.BufferedWriter
import java.io.FileNotFoundException
import java.io.FileOutputStream
import java.io.IOException
import java.io.OutputStreamWriter
import java.util.LinkedList
class DebugLogService : Service(), Logcat.Callback, Runnable {
@ -201,9 +210,11 @@ class DebugLogService : Service(), Logcat.Callback, Runnable {
bw.write("Storage ALL access: ${Permissions.hasAllAccess(this)}\r\n")
bw.write("Notifications: ${Permissions.canSendNotifications(this)}\r\n")
bw.write("PiP Allowed: ${Permissions.isPiPAllowed(this)}\r\n")
bw.write("____________________________\r\n")
try {
bw.write("Changed settings:\r\n${PreferenceParser.getChangedPrefsString(this)}\r\n")
bw.write("____________________________\r\n")
bw.write("Changed settings:\r\n")
bw.write("____________________________\r\n")
bw.write("${PreferenceParser.getChangedPrefsString(this)}\r\n")
} catch (e: Exception) {
bw.write("Cannot retrieve changed settings\r\n")
bw.write(Log.getStackTraceString(e))

6
application/vlc-android/src/org/videolan/vlc/gui/helpers/FeedbackUtil.kt

@ -115,9 +115,11 @@ object FeedbackUtil {
append("Storage ALL access: ${Permissions.hasAllAccess(context)}\r\n")
append("Notifications: ${Permissions.canSendNotifications(context)}\r\n")
append("PiP Allowed: ${Permissions.isPiPAllowed(context)}\r\n")
append("____________________________\r\n")
try {
append("Changed settings:\r\n${PreferenceParser.getChangedPrefsString(context)}\r\n")
append("____________________________\r\n")
append("Changed settings:\r\n")
append("____________________________\r\n")
append("${PreferenceParser.getChangedPrefsString(context)}\r\n")
} catch (e: Exception) {
append("Cannot retrieve changed settings\r\n")
append(Log.getStackTraceString(e))

Loading…
Cancel
Save