forked from jens/Automation
removed function
This commit is contained in:
parent
aca5572f40
commit
d1ca9ab56b
@ -781,31 +781,6 @@ public class Actions
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
|
||||||
public static void setDoNotDisturb(Context context, int desiredSetting)
|
|
||||||
{
|
|
||||||
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
|
||||||
|
|
||||||
// Check if the notification policy access has been granted for the app.
|
|
||||||
/* if (!notificationManager.isNotificationPolicyAccessGranted())
|
|
||||||
{
|
|
||||||
Intent intent = new Intent(android.provider.Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS);
|
|
||||||
startActivity(intent);
|
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
notificationManager.setInterruptionFilter(desiredSetting);
|
|
||||||
|
|
||||||
/*if (notificationManager.getCurrentInterruptionFilter() == NotificationManager.INTERRUPTION_FILTER_ALL)
|
|
||||||
{
|
|
||||||
notificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_NONE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
notificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_ALL);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||||
public static boolean isDoNotDisturbActive(Context context)
|
public static boolean isDoNotDisturbActive(Context context)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user