mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Debug cursor window size
This commit is contained in:
parent
9d9a23561e
commit
e5a4826a90
3 changed files with 27 additions and 1 deletions
|
@ -70,6 +70,7 @@ import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -146,6 +147,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
private TextView tvStorageUsage;
|
private TextView tvStorageUsage;
|
||||||
private TextView tvSuffixes;
|
private TextView tvSuffixes;
|
||||||
private TextView tvFingerprint;
|
private TextView tvFingerprint;
|
||||||
|
private TextView tvCursorWindow;
|
||||||
private Button btnGC;
|
private Button btnGC;
|
||||||
private Button btnCharsets;
|
private Button btnCharsets;
|
||||||
private Button btnCiphers;
|
private Button btnCiphers;
|
||||||
|
@ -266,6 +268,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
tvStorageUsage = view.findViewById(R.id.tvStorageUsage);
|
tvStorageUsage = view.findViewById(R.id.tvStorageUsage);
|
||||||
tvSuffixes = view.findViewById(R.id.tvSuffixes);
|
tvSuffixes = view.findViewById(R.id.tvSuffixes);
|
||||||
tvFingerprint = view.findViewById(R.id.tvFingerprint);
|
tvFingerprint = view.findViewById(R.id.tvFingerprint);
|
||||||
|
tvCursorWindow = view.findViewById(R.id.tvCursorWindow);
|
||||||
btnGC = view.findViewById(R.id.btnGC);
|
btnGC = view.findViewById(R.id.btnGC);
|
||||||
btnCharsets = view.findViewById(R.id.btnCharsets);
|
btnCharsets = view.findViewById(R.id.btnCharsets);
|
||||||
btnCiphers = view.findViewById(R.id.btnCiphers);
|
btnCiphers = view.findViewById(R.id.btnCiphers);
|
||||||
|
@ -1172,6 +1175,17 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
|
|
||||||
tvFingerprint.setText(Helper.getFingerprint(getContext()));
|
tvFingerprint.setText(Helper.getFingerprint(getContext()));
|
||||||
|
|
||||||
|
int cursorWindowSize = -1;
|
||||||
|
try {
|
||||||
|
Field fCursorWindowSize = io.requery.android.database.CursorWindow.class.getDeclaredField("sDefaultCursorWindowSize");
|
||||||
|
fCursorWindowSize.setAccessible(true);
|
||||||
|
cursorWindowSize = fCursorWindowSize.getInt(null);
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.w(ex);
|
||||||
|
}
|
||||||
|
tvCursorWindow.setText(getString(R.string.title_advanced_cursor_window,
|
||||||
|
Helper.humanReadableByteCount(cursorWindowSize, false)));
|
||||||
|
|
||||||
cardDebug.setVisibility(swDebug.isChecked() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
cardDebug.setVisibility(swDebug.isChecked() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -855,6 +855,17 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvMemoryUsage" />
|
app:layout_constraintTop_toBottomOf="@id/tvMemoryUsage" />
|
||||||
|
|
||||||
|
<eu.faircode.email.FixedTextView
|
||||||
|
android:id="@+id/tvCursorWindow"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/title_advanced_cursor_window"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvStorageUsage" />
|
||||||
|
|
||||||
<eu.faircode.email.FixedTextView
|
<eu.faircode.email.FixedTextView
|
||||||
android:id="@+id/tvSuffixes"
|
android:id="@+id/tvSuffixes"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -864,7 +875,7 @@
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvStorageUsage" />
|
app:layout_constraintTop_toBottomOf="@id/tvCursorWindow" />
|
||||||
|
|
||||||
<eu.faircode.email.FixedTextView
|
<eu.faircode.email.FixedTextView
|
||||||
android:id="@+id/tvFingerprint"
|
android:id="@+id/tvFingerprint"
|
||||||
|
|
|
@ -662,6 +662,7 @@
|
||||||
<string name="title_advanced_memory_class" translatable="false">Memory class: %1$s/%2$s Total: %3$s</string>
|
<string name="title_advanced_memory_class" translatable="false">Memory class: %1$s/%2$s Total: %3$s</string>
|
||||||
<string name="title_advanced_memory_usage" translatable="false">Memory usage: %1$s/%2$s Native: %3$s</string>
|
<string name="title_advanced_memory_usage" translatable="false">Memory usage: %1$s/%2$s Native: %3$s</string>
|
||||||
<string name="title_advanced_storage_usage" translatable="false">Storage space: %1$s/%2$s App: %3$s</string>
|
<string name="title_advanced_storage_usage" translatable="false">Storage space: %1$s/%2$s App: %3$s</string>
|
||||||
|
<string name="title_advanced_cursor_window" translatable="false">Cursor window size: %1$s</string>
|
||||||
<string name="title_advanced_suffixes" translatable="false">Public suffix list: %1$d</string>
|
<string name="title_advanced_suffixes" translatable="false">Public suffix list: %1$d</string>
|
||||||
<string name="title_advanced_gc" translatable="false">GC</string>
|
<string name="title_advanced_gc" translatable="false">GC</string>
|
||||||
<string name="title_advanced_charsets" translatable="false">Charsets</string>
|
<string name="title_advanced_charsets" translatable="false">Charsets</string>
|
||||||
|
|
Loading…
Reference in a new issue