Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fd71484 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

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
parent de08d984
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -97,17 +97,13 @@ public class ZenAccessController extends BasePreferenceController {

    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);
        });
    }

    public static void deleteRules(final Context context, final String pkg) {
        AsyncTask.execute(() -> {
       final NotificationManager mgr = context.getSystemService(NotificationManager.class);
       mgr.removeAutomaticZenRules(pkg);
        });
    }

    @VisibleForTesting