Improve logging and the naming of some fields.

This commit is contained in:
Greyson Parrelli
2024-01-12 14:43:22 -05:00
parent 64fff2adb2
commit e361795184
12 changed files with 65 additions and 63 deletions

View File

@@ -19,22 +19,24 @@ final class LogSectionKeyPreferences implements LogSection {
@Override
public @NonNull CharSequence getContent(@NonNull Context context) {
return new StringBuilder().append("Screen Lock : ").append(TextSecurePreferences.isScreenLockEnabled(context)).append("\n")
.append("Screen Lock Timeout : ").append(TextSecurePreferences.getScreenLockTimeout(context)).append("\n")
.append("Password Disabled : ").append(TextSecurePreferences.isPasswordDisabled(context)).append("\n")
.append("Prefer Contact Photos: ").append(SignalStore.settings().isPreferSystemContactPhotos()).append("\n")
.append("Call Data Mode : ").append(SignalStore.settings().getCallDataMode()).append("\n")
.append("Media Quality : ").append(SignalStore.settings().getSentMediaQuality()).append("\n")
.append("Client Deprecated : ").append(SignalStore.misc().isClientDeprecated()).append("\n")
.append("Push Registered : ").append(SignalStore.account().isRegistered()).append("\n")
.append("Unauthorized Received: ").append(TextSecurePreferences.isUnauthorizedReceived(context)).append("\n")
.append("self.isRegistered() : ").append(SignalStore.account().getAci() == null ? "false" : Recipient.self().isRegistered()).append("\n")
.append("Thread Trimming : ").append(getThreadTrimmingString()).append("\n")
.append("Censorship Setting : ").append(SignalStore.settings().getCensorshipCircumventionEnabled()).append("\n")
.append("Network Reachable : ").append(SignalStore.misc().isServiceReachableWithoutCircumvention()).append(", last checked: ").append(SignalStore.misc().getLastCensorshipServiceReachabilityCheckTime()).append("\n")
.append("Wifi Download : ").append(Util.join(TextSecurePreferences.getWifiMediaDownloadAllowed(context), ",")).append("\n")
.append("Roaming Download : ").append(Util.join(TextSecurePreferences.getRoamingMediaDownloadAllowed(context), ",")).append("\n")
.append("Mobile Download : ").append(Util.join(TextSecurePreferences.getMobileMediaDownloadAllowed(context), ",")).append("\n");
return new StringBuilder().append("Screen Lock : ").append(TextSecurePreferences.isScreenLockEnabled(context)).append("\n")
.append("Screen Lock Timeout : ").append(TextSecurePreferences.getScreenLockTimeout(context)).append("\n")
.append("Password Disabled : ").append(TextSecurePreferences.isPasswordDisabled(context)).append("\n")
.append("Prefer Contact Photos : ").append(SignalStore.settings().isPreferSystemContactPhotos()).append("\n")
.append("Call Data Mode : ").append(SignalStore.settings().getCallDataMode()).append("\n")
.append("Media Quality : ").append(SignalStore.settings().getSentMediaQuality()).append("\n")
.append("Client Deprecated : ").append(SignalStore.misc().isClientDeprecated()).append("\n")
.append("Push Registered : ").append(SignalStore.account().isRegistered()).append("\n")
.append("Unauthorized Received : ").append(TextSecurePreferences.isUnauthorizedReceived(context)).append("\n")
.append("self.isRegistered() : ").append(SignalStore.account().getAci() == null ? "false" : Recipient.self().isRegistered()).append("\n")
.append("Thread Trimming : ").append(getThreadTrimmingString()).append("\n")
.append("Censorship Setting : ").append(SignalStore.settings().getCensorshipCircumventionEnabled()).append("\n")
.append("Network Reachable : ").append(SignalStore.misc().isServiceReachableWithoutCircumvention()).append(", last checked: ").append(SignalStore.misc().getLastCensorshipServiceReachabilityCheckTime()).append("\n")
.append("Wifi Download : ").append(Util.join(TextSecurePreferences.getWifiMediaDownloadAllowed(context), ",")).append("\n")
.append("Roaming Download : ").append(Util.join(TextSecurePreferences.getRoamingMediaDownloadAllowed(context), ",")).append("\n")
.append("Mobile Download : ").append(Util.join(TextSecurePreferences.getMobileMediaDownloadAllowed(context), ",")).append("\n")
.append("Phone Number Sharing : ").append(SignalStore.phoneNumberPrivacy().isPhoneNumberSharingEnabled()).append(" (").append(SignalStore.phoneNumberPrivacy().getPhoneNumberSharingMode()).append(")\n")
.append("Phone Number Discoverable: ").append(SignalStore.phoneNumberPrivacy().isDiscoverableByPhoneNumber()).append(" (").append(SignalStore.phoneNumberPrivacy().getPhoneNumberDiscoverabilityMode()).append(")\n");
}
private static String getThreadTrimmingString() {