Remove unnecessary async
Because if the work wasn't scheduled by the time the main page was
shown, the switch would be shown in the wrong state. And these
calls are fast, and can be done on the main thread
Test: turn off DND access for apps with DND rules
Fixes: 207058117
Change-Id: I186413f4237ef754bdfa5cc469e1b7be4ff71f2c
diff --git a/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java
index 8460879..2c52a8c 100644
--- a/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java
+++ b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java
@@ -97,17 +97,13 @@
public static void setAccess(final Context context, final String pkg, final boolean access) {
logSpecialPermissionChange(access, pkg, context);
- AsyncTask.execute(() -> {
- final NotificationManager mgr = context.getSystemService(NotificationManager.class);
- mgr.setNotificationPolicyAccessGranted(pkg, access);
- });
+ final NotificationManager mgr = context.getSystemService(NotificationManager.class);
+ mgr.setNotificationPolicyAccessGranted(pkg, access);
}
public static void deleteRules(final Context context, final String pkg) {
- AsyncTask.execute(() -> {
- final NotificationManager mgr = context.getSystemService(NotificationManager.class);
- mgr.removeAutomaticZenRules(pkg);
- });
+ final NotificationManager mgr = context.getSystemService(NotificationManager.class);
+ mgr.removeAutomaticZenRules(pkg);
}
@VisibleForTesting