mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 14:17:03 +02:00
Added UI mode to debug info
This commit is contained in:
@@ -24,6 +24,7 @@ import android.app.ApplicationExitInfo;
|
||||
import android.app.Dialog;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.UiModeManager;
|
||||
import android.app.usage.UsageStatsManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -1684,6 +1685,23 @@ public class Log {
|
||||
size.x / density, size.y / density,
|
||||
context.getResources().getConfiguration().isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_NORMAL)));
|
||||
|
||||
int uiMode = context.getResources().getConfiguration().uiMode;
|
||||
sb.append(String.format("UI mode: 0x"))
|
||||
.append(Integer.toHexString(uiMode))
|
||||
.append(" night")
|
||||
.append(" no=").append((uiMode & Configuration.UI_MODE_NIGHT_NO) != 0)
|
||||
.append(" yes=").append((uiMode & Configuration.UI_MODE_NIGHT_YES) != 0)
|
||||
.append("\r\n");
|
||||
|
||||
UiModeManager uim = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE);
|
||||
int nightMode = uim.getNightMode();
|
||||
sb.append(String.format("Night mode: 0x"))
|
||||
.append(Integer.toHexString(nightMode))
|
||||
.append(" no=").append((nightMode & UiModeManager.MODE_NIGHT_NO) != 0)
|
||||
.append(" yes=").append((nightMode & UiModeManager.MODE_NIGHT_YES) != 0)
|
||||
.append(" custom=").append((nightMode & UiModeManager.MODE_NIGHT_CUSTOM) != 0)
|
||||
.append("\r\n");
|
||||
|
||||
try {
|
||||
int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");
|
||||
sb.append(context.getString(R.string.title_advanced_aes_key_size, maxKeySize)).append("\r\n");
|
||||
|
||||
Reference in New Issue
Block a user