Add notification profile information to debug log.

fork-5.53.8
Cody Henthorne 2022-01-03 16:34:08 -05:00 zatwierdzone przez Greyson Parrelli
rodzic ae40a65924
commit 3781e1dd60
2 zmienionych plików z 39 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,38 @@
package org.thoughtcrime.securesms.logsubmit
import android.content.Context
import org.thoughtcrime.securesms.database.SignalDatabase
import org.thoughtcrime.securesms.keyvalue.SignalStore
import org.thoughtcrime.securesms.notifications.profiles.NotificationProfile
class LogSectionNotificationProfiles : LogSection {
override fun getTitle(): String = "NOTIFICATION PROFILES"
override fun getContent(context: Context): CharSequence {
val profiles: List<NotificationProfile> = SignalDatabase.notificationProfiles.getProfiles()
val output = StringBuilder()
output.append("Manually enabled profile: ${SignalStore.notificationProfileValues().manuallyEnabledProfile}\n")
output.append("Manually enabled until : ${SignalStore.notificationProfileValues().manuallyEnabledUntil}\n")
output.append("Manually disabled at : ${SignalStore.notificationProfileValues().manuallyDisabledAt}\n")
output.append("Now : ${System.currentTimeMillis()}\n\n")
output.append("Profiles:\n")
if (profiles.isEmpty()) {
output.append(" No notification profiles")
} else {
profiles.forEach { profile ->
output.append(" Profile ${profile.id}\n")
output.append(" allowMentions : ${profile.allowAllMentions}\n")
output.append(" allowCalls : ${profile.allowAllCalls}\n")
output.append(" schedule enabled: ${profile.schedule.enabled}\n")
output.append(" schedule start : ${profile.schedule.start}\n")
output.append(" schedule end : ${profile.schedule.end}\n")
output.append(" schedule days : ${profile.schedule.daysEnabled.sorted()}\n")
}
}
return output.toString()
}
}

Wyświetl plik

@ -82,6 +82,7 @@ public class SubmitDebugLogRepository {
add(new LogSectionPower());
}
add(new LogSectionNotifications());
add(new LogSectionNotificationProfiles());
add(new LogSectionKeyPreferences());
add(new LogSectionBadges());
add(new LogSectionPermissions());