mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-14 04:53:22 +02:00
Don't kill
This commit is contained in:
@@ -59,7 +59,7 @@ public class FragmentDialogPermissions extends FragmentDialogBase {
|
||||
tvDozeDevice.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Helper.view(context, Uri.parse(Helper.DONTKILL_URI), true);
|
||||
Helper.view(v.getContext(), Uri.parse(Helper.DONTKILL_URI), true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ public class FragmentSetup extends FragmentBase implements SharedPreferences.OnS
|
||||
private Button btnDoze;
|
||||
private TextView tvDoze12;
|
||||
private TextView tvDozeWhy;
|
||||
private TextView tvKilling;
|
||||
|
||||
private Button btnBackgroundRestricted;
|
||||
private Button btnDataSaver;
|
||||
@@ -200,6 +201,7 @@ public class FragmentSetup extends FragmentBase implements SharedPreferences.OnS
|
||||
btnDoze = view.findViewById(R.id.btnDoze);
|
||||
tvDoze12 = view.findViewById(R.id.tvDoze12);
|
||||
tvDozeWhy = view.findViewById(R.id.tvDozeWhy);
|
||||
tvKilling = view.findViewById(R.id.tvKilling);
|
||||
|
||||
btnBackgroundRestricted = view.findViewById(R.id.btnBackgroundRestricted);
|
||||
btnDataSaver = view.findViewById(R.id.btnDataSaver);
|
||||
@@ -588,6 +590,15 @@ public class FragmentSetup extends FragmentBase implements SharedPreferences.OnS
|
||||
}
|
||||
});
|
||||
|
||||
tvKilling.setPaintFlags(tvKilling.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
|
||||
tvKilling.setVisibility(Helper.isAggressivelyKilling() ? View.VISIBLE : View.GONE);
|
||||
tvKilling.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Helper.view(v.getContext(), Uri.parse(Helper.DONTKILL_URI), true);
|
||||
}
|
||||
});
|
||||
|
||||
tvStamina.setPaintFlags(tvStamina.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
|
||||
tvStamina.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -1514,6 +1514,14 @@ public class Helper {
|
||||
isSony());
|
||||
}
|
||||
|
||||
static boolean isAggressivelyKilling() {
|
||||
return (BuildConfig.DEBUG ||
|
||||
isSamsung() ||
|
||||
isOnePlus() ||
|
||||
isHuawei() ||
|
||||
isXiaomi());
|
||||
}
|
||||
|
||||
static boolean isAndroid12() {
|
||||
return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user