Activity manager context

This commit is contained in:
M66B 2022-05-24 09:29:18 +02:00
parent cb8db06dff
commit cc7363eff5
2 changed files with 3 additions and 3 deletions

View File

@ -1667,7 +1667,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private void setOptions() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
ActivityManager am = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE);
ActivityManager am = Helper.getSystemService(getContext(), ActivityManager.class);
int class_mb = am.getMemoryClass();
int class_large_mb = am.getLargeMemoryClass();
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();

View File

@ -1229,7 +1229,7 @@ public class Helper {
static void excludeFromRecents(Context context) {
try {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
ActivityManager am = Helper.getSystemService(context, ActivityManager.class);;
if (am == null)
return;
@ -2667,7 +2667,7 @@ public class Helper {
}
static void clearAll(Context context) {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
ActivityManager am = Helper.getSystemService(context, ActivityManager.class);;
am.clearApplicationUserData();
}
}