Merge "Remove unnecessary async" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1d15b24da2
@@ -97,17 +97,13 @@ public class ZenAccessController extends BasePreferenceController {
|
|||||||
|
|
||||||
public static void setAccess(final Context context, final String pkg, final boolean access) {
|
public static void setAccess(final Context context, final String pkg, final boolean access) {
|
||||||
logSpecialPermissionChange(access, pkg, context);
|
logSpecialPermissionChange(access, pkg, context);
|
||||||
AsyncTask.execute(() -> {
|
final NotificationManager mgr = context.getSystemService(NotificationManager.class);
|
||||||
final NotificationManager mgr = context.getSystemService(NotificationManager.class);
|
mgr.setNotificationPolicyAccessGranted(pkg, access);
|
||||||
mgr.setNotificationPolicyAccessGranted(pkg, access);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteRules(final Context context, final String pkg) {
|
public static void deleteRules(final Context context, final String pkg) {
|
||||||
AsyncTask.execute(() -> {
|
final NotificationManager mgr = context.getSystemService(NotificationManager.class);
|
||||||
final NotificationManager mgr = context.getSystemService(NotificationManager.class);
|
mgr.removeAutomaticZenRules(pkg);
|
||||||
mgr.removeAutomaticZenRules(pkg);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
Reference in New Issue
Block a user