mirror of https://github.com/M66B/FairEmail.git
Debug: contact info
This commit is contained in:
parent
96c819d270
commit
c854040dde
|
@ -1038,6 +1038,12 @@ public class ContactInfo {
|
|||
return all;
|
||||
}
|
||||
|
||||
static int[] getStats() {
|
||||
synchronized (emailContactInfo) {
|
||||
return new int[]{emailLookup.size(), emailContactInfo.size()};
|
||||
}
|
||||
}
|
||||
|
||||
private static class Lookup {
|
||||
Uri uri;
|
||||
String displayName;
|
||||
|
|
|
@ -178,6 +178,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
private TextView tvMemoryClass;
|
||||
private TextView tvMemoryUsage;
|
||||
private TextView tvStorageUsage;
|
||||
private TextView tvContactInfo;
|
||||
private TextView tvSuffixes;
|
||||
private TextView tvAndroidId;
|
||||
private TextView tvFingerprint;
|
||||
|
@ -343,6 +344,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
tvMemoryClass = view.findViewById(R.id.tvMemoryClass);
|
||||
tvMemoryUsage = view.findViewById(R.id.tvMemoryUsage);
|
||||
tvStorageUsage = view.findViewById(R.id.tvStorageUsage);
|
||||
tvContactInfo = view.findViewById(R.id.tvContactInfo);
|
||||
tvSuffixes = view.findViewById(R.id.tvSuffixes);
|
||||
tvAndroidId = view.findViewById(R.id.tvAndroidId);
|
||||
tvFingerprint = view.findViewById(R.id.tvFingerprint);
|
||||
|
@ -1481,6 +1483,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
setContactInfo();
|
||||
setSuffixes();
|
||||
setPermissionInfo();
|
||||
}
|
||||
|
@ -1826,6 +1829,11 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
time < 0 ? "-" : DTF.format(time)));
|
||||
}
|
||||
|
||||
private void setContactInfo() {
|
||||
int[] stats = ContactInfo.getStats();
|
||||
tvContactInfo.setText(getString(R.string.title_advanced_contact_info, stats[0], stats[1]));
|
||||
}
|
||||
|
||||
private void setSuffixes() {
|
||||
new SimpleTask<Integer>() {
|
||||
@Override
|
||||
|
|
|
@ -1887,6 +1887,10 @@ public class Log {
|
|||
|
||||
sb.append("\r\n");
|
||||
|
||||
int[] contacts = ContactInfo.getStats();
|
||||
sb.append(String.format("Contact lookup: %d cached: %s\r\n",
|
||||
contacts[0], contacts[1]));
|
||||
|
||||
Locale slocale = Resources.getSystem().getConfiguration().locale;
|
||||
String language = prefs.getString("language", null);
|
||||
sb.append(String.format("Locale: def=%s sys=%s lang=%s\r\n",
|
||||
|
|
|
@ -1453,6 +1453,17 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvStorageUsage" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvContactInfo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/title_advanced_contact_info"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textIsSelectable="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCursorWindow" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvSuffixes"
|
||||
android:layout_width="0dp"
|
||||
|
@ -1462,7 +1473,7 @@
|
|||
android:textIsSelectable="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCursorWindow" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvContactInfo" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvAndroidId"
|
||||
|
|
|
@ -751,6 +751,7 @@
|
|||
<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_cursor_window" translatable="false">Cursor window size: %1$s</string>
|
||||
<string name="title_advanced_contact_info" translatable="false">Contact lookup: %1$d cached: %2$d</string>
|
||||
<string name="title_advanced_suffixes" translatable="false">Public suffix list: %1$d</string>
|
||||
<string name="title_advanced_android_id" translatable="false">Android ID: %1$s</string>
|
||||
<string name="title_advanced_gc" translatable="false">GC</string>
|
||||
|
|
Loading…
Reference in New Issue