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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user