mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 06:08:31 +02:00
Refactoring
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user