|
|
@ -37,6 +37,7 @@ import android.os.Bundle;
|
|
|
|
import android.os.Debug;
|
|
|
|
import android.os.Debug;
|
|
|
|
import android.provider.Settings;
|
|
|
|
import android.provider.Settings;
|
|
|
|
import android.text.SpannableStringBuilder;
|
|
|
|
import android.text.SpannableStringBuilder;
|
|
|
|
|
|
|
|
import android.text.Spanned;
|
|
|
|
import android.text.style.RelativeSizeSpan;
|
|
|
|
import android.text.style.RelativeSizeSpan;
|
|
|
|
import android.text.style.StyleSpan;
|
|
|
|
import android.text.style.StyleSpan;
|
|
|
|
import android.util.Pair;
|
|
|
|
import android.util.Pair;
|
|
|
@ -143,6 +144,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
private TextView tvMemoryClass;
|
|
|
|
private TextView tvMemoryClass;
|
|
|
|
private TextView tvMemoryUsage;
|
|
|
|
private TextView tvMemoryUsage;
|
|
|
|
private TextView tvStorageUsage;
|
|
|
|
private TextView tvStorageUsage;
|
|
|
|
|
|
|
|
private TextView tvSuffixes;
|
|
|
|
private TextView tvFingerprint;
|
|
|
|
private TextView tvFingerprint;
|
|
|
|
private Button btnGC;
|
|
|
|
private Button btnGC;
|
|
|
|
private Button btnCharsets;
|
|
|
|
private Button btnCharsets;
|
|
|
@ -262,6 +264,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
tvMemoryClass = view.findViewById(R.id.tvMemoryClass);
|
|
|
|
tvMemoryClass = view.findViewById(R.id.tvMemoryClass);
|
|
|
|
tvMemoryUsage = view.findViewById(R.id.tvMemoryUsage);
|
|
|
|
tvMemoryUsage = view.findViewById(R.id.tvMemoryUsage);
|
|
|
|
tvStorageUsage = view.findViewById(R.id.tvStorageUsage);
|
|
|
|
tvStorageUsage = view.findViewById(R.id.tvStorageUsage);
|
|
|
|
|
|
|
|
tvSuffixes = view.findViewById(R.id.tvSuffixes);
|
|
|
|
tvFingerprint = view.findViewById(R.id.tvFingerprint);
|
|
|
|
tvFingerprint = view.findViewById(R.id.tvFingerprint);
|
|
|
|
btnGC = view.findViewById(R.id.btnGC);
|
|
|
|
btnGC = view.findViewById(R.id.btnGC);
|
|
|
|
btnCharsets = view.findViewById(R.id.btnCharsets);
|
|
|
|
btnCharsets = view.findViewById(R.id.btnCharsets);
|
|
|
@ -959,8 +962,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
|
|
|
|
|
|
|
setLastCleanup(prefs.getLong("last_cleanup", -1));
|
|
|
|
setLastCleanup(prefs.getLong("last_cleanup", -1));
|
|
|
|
|
|
|
|
|
|
|
|
setPermissionInfo();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swExactAlarms.setEnabled(AlarmManagerCompatEx.canScheduleExactAlarms(getContext()));
|
|
|
|
swExactAlarms.setEnabled(AlarmManagerCompatEx.canScheduleExactAlarms(getContext()));
|
|
|
|
swTestIab.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
|
|
|
swTestIab.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
|
|
|
@ -969,6 +970,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
return view;
|
|
|
|
return view;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
|
|
|
|
|
|
super.onViewCreated(view, savedInstanceState);
|
|
|
|
|
|
|
|
setSuffixes();
|
|
|
|
|
|
|
|
setPermissionInfo();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onResume() {
|
|
|
|
public void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
super.onResume();
|
|
|
@ -1227,8 +1235,40 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
time < 0 ? "-" : DTF.format(time)));
|
|
|
|
time < 0 ? "-" : DTF.format(time)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void setSuffixes() {
|
|
|
|
|
|
|
|
new SimpleTask<Integer>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onPreExecute(Bundle args) {
|
|
|
|
|
|
|
|
tvSuffixes.setText(getString(R.string.title_advanced_suffixes, -1));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected Integer onExecute(Context context, Bundle args) {
|
|
|
|
|
|
|
|
return UriHelper.getSuffixCount(context);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Integer count) {
|
|
|
|
|
|
|
|
tvSuffixes.setText(getString(R.string.title_advanced_suffixes, count));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
|
|
|
Log.w(ex);
|
|
|
|
|
|
|
|
tvSuffixes.setText(ex.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}.execute(this, new Bundle(), "suffixes");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void setPermissionInfo() {
|
|
|
|
private void setPermissionInfo() {
|
|
|
|
try {
|
|
|
|
new SimpleTask<Spanned>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onPreExecute(Bundle args) {
|
|
|
|
|
|
|
|
tvPermissions.setText(null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected Spanned onExecute(Context context, Bundle args) throws Throwable {
|
|
|
|
int start = 0;
|
|
|
|
int start = 0;
|
|
|
|
int dp24 = Helper.dp2pixels(getContext(), 24);
|
|
|
|
int dp24 = Helper.dp2pixels(getContext(), 24);
|
|
|
|
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
|
|
|
|
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
|
|
|
@ -1295,11 +1335,21 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
|
|
|
|
|
|
|
ssb.append('\n');
|
|
|
|
ssb.append('\n');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tvPermissions.setText(ssb);
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
return ssb;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Spanned permissions) {
|
|
|
|
|
|
|
|
tvPermissions.setText(permissions);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
Log.w(ex);
|
|
|
|
Log.w(ex);
|
|
|
|
tvPermissions.setText(ex.toString());
|
|
|
|
tvPermissions.setText(ex.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}.execute(this, new Bundle(), "permissions");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static class StorageData {
|
|
|
|
private static class StorageData {
|
|
|
|