Remove unneeded AsyncTask

Change-Id: I962a61c7a73f1d7a464ee76284f1d4175d04e62a
This commit is contained in:
Julia Reynolds
2024-06-14 14:42:50 +00:00
parent 7652089fa4
commit 54a357fc3a

View File

@@ -139,16 +139,14 @@ public class ApprovalPreferenceController extends BasePreferenceController {
public void disable(final ComponentName cn) { public void disable(final ComponentName cn) {
logSpecialPermissionChange(true, cn.getPackageName()); logSpecialPermissionChange(true, cn.getPackageName());
mNm.setNotificationListenerAccessGranted(cn, false); mNm.setNotificationListenerAccessGranted(cn, false);
AsyncTask.execute(() -> { if (!mNm.isNotificationPolicyAccessGrantedForPackage(
if (!mNm.isNotificationPolicyAccessGrantedForPackage( cn.getPackageName())) {
cn.getPackageName())) { if (android.app.Flags.modesApi()) {
if (android.app.Flags.modesApi()) { mNm.removeAutomaticZenRules(cn.getPackageName(), /* fromUser= */ true);
mNm.removeAutomaticZenRules(cn.getPackageName(), /* fromUser= */ true); } else {
} else { mNm.removeAutomaticZenRules(cn.getPackageName());
mNm.removeAutomaticZenRules(cn.getPackageName());
}
} }
}); }
} }
protected void enable(ComponentName cn) { protected void enable(ComponentName cn) {