Debug: task description

pull/214/head
M66B 10 months ago
parent a9da966035
commit 8d1c2875fa

@ -166,11 +166,16 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
d.setTint(Color.WHITE);
d.draw(canvas);
int colorPrimary = colorPrimaryDark;
boolean task_description = prefs.getBoolean("task_description", true);
int colorPrimary;
if (task_description) {
colorPrimary = colorPrimaryDark;
if (colorPrimary != 0 && Color.alpha(colorPrimary) != 255) {
Log.w("Task color primary=" + Integer.toHexString(colorPrimary));
colorPrimary = ColorUtils.setAlphaComponent(colorPrimary, 255);
}
} else
colorPrimary = getColor(R.color.lightBluePrimary);
ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(
null, bm, colorPrimary);

@ -168,6 +168,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swAutostart;
private SwitchCompat swEmergency;
private SwitchCompat swWorkManager;
private SwitchCompat swTaskDescription;
private SwitchCompat swExternalStorage;
private TextView tvExternalStorageFolder;
private SwitchCompat swIntegrity;
@ -276,7 +277,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"crash_reports", "cleanup_attachments",
"watchdog", "experiments", "main_log", "main_log_memory", "protocol", "log_level", "debug", "leak_canary",
"test1", "test2", "test3", "test4", "test5",
"emergency_file", "work_manager", // "external_storage",
"emergency_file", "work_manager", "task_description", // "external_storage",
"sqlite_integrity_check", "wal", "sqlite_checkpoints", "sqlite_analyze", "sqlite_auto_vacuum", "sqlite_sync_extra", "sqlite_cache",
"oauth_tabs",
"chunk_size", "thread_range",
@ -410,6 +411,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swAutostart = view.findViewById(R.id.swAutostart);
swEmergency = view.findViewById(R.id.swEmergency);
swWorkManager = view.findViewById(R.id.swWorkManager);
swTaskDescription = view.findViewById(R.id.swTaskDescription);
swExternalStorage = view.findViewById(R.id.swExternalStorage);
tvExternalStorageFolder = view.findViewById(R.id.tvExternalStorageFolder);
swIntegrity = view.findViewById(R.id.swIntegrity);
@ -1096,6 +1098,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swTaskDescription.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton v, boolean isChecked) {
prefs.edit().putBoolean("task_description", isChecked).apply();
}
});
swExternalStorage.setEnabled(Helper.getExternalFilesDir(getContext()) != null);
swExternalStorage.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
@ -2315,6 +2324,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swAutostart.setChecked(Helper.isComponentEnabled(getContext(), ReceiverAutoStart.class));
swEmergency.setChecked(prefs.getBoolean("emergency_file", true));
swWorkManager.setChecked(prefs.getBoolean("work_manager", true));
swTaskDescription.setChecked(prefs.getBoolean("task_description", true));
swExternalStorage.setChecked(prefs.getBoolean("external_storage", false));
swIntegrity.setChecked(prefs.getBoolean("sqlite_integrity_check", true));

@ -997,6 +997,18 @@
app:layout_constraintTop_toBottomOf="@id/swEmergency"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swTaskDescription"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_task_description"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swWorkManager"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swExternalStorage"
android:layout_width="0dp"
@ -1008,7 +1020,7 @@
app:drawableTint="?attr/colorWarning"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swWorkManager"
app:layout_constraintTop_toBottomOf="@id/swTaskDescription"
app:switchPadding="12dp" />
<TextView

@ -905,6 +905,7 @@
<string name="title_advanced_autostart" translatable="false">Autostart app</string>
<string name="title_advanced_emergency" translatable="false">Write emergency file</string>
<string name="title_advanced_work_manager" translatable="false">Initialize work manager</string>
<string name="title_advanced_task_description" translatable="false">Set task description</string>
<string name="title_advanced_external_storage" translatable="false">Use external storage</string>
<string name="title_advanced_integrity" translatable="false">sqlite integrity check</string>
<string name="title_advanced_wal" translatable="false">sqlite WAL</string>

Loading…
Cancel
Save