Refactoring

This commit is contained in:
M66B
2022-07-29 18:11:32 +02:00
parent c3f380f0b5
commit 28b479c478
2 changed files with 21 additions and 23 deletions

View File

@@ -30,6 +30,7 @@ import android.app.Activity;
import android.app.ActivityManager;
import android.app.ApplicationExitInfo;
import android.app.KeyguardManager;
import android.app.NotificationManager;
import android.app.UiModeManager;
import android.app.usage.UsageEvents;
import android.app.usage.UsageStatsManager;
@@ -732,6 +733,23 @@ public class Helper {
}
}
static String getInterruptionFilter(int filter) {
switch (filter) {
case NotificationManager.INTERRUPTION_FILTER_UNKNOWN:
return "Unknown";
case NotificationManager.INTERRUPTION_FILTER_ALL:
return "All";
case NotificationManager.INTERRUPTION_FILTER_PRIORITY:
return "Priority";
case NotificationManager.INTERRUPTION_FILTER_NONE:
return "None";
case NotificationManager.INTERRUPTION_FILTER_ALARMS:
return "Alarms";
default:
return Integer.toString(filter);
}
}
static <T extends Object> T getSystemService(Context context, Class<T> type) {
return ContextCompat.getSystemService(context.getApplicationContext(), type);
}