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

Commit 070889a3 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE when deleting old zen rules" into sc-dev

parents 18650530 b4fe101e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -417,7 +417,14 @@ public class ZenModeHelper {
            newConfig = mConfig.copy();
            for (int i = newConfig.automaticRules.size() - 1; i >= 0; i--) {
                ZenRule rule = newConfig.automaticRules.get(newConfig.automaticRules.keyAt(i));
                if (rule.pkg.equals(packageName) && canManageAutomaticZenRule(rule)) {
                String pkg = rule.pkg != null
                        ? rule.pkg
                        : (rule.component != null)
                                ? rule.component.getPackageName()
                                : (rule.configurationActivity != null)
                                        ? rule.configurationActivity.getPackageName()
                                        : null;
                if (Objects.equals(pkg, packageName) && canManageAutomaticZenRule(rule)) {
                    newConfig.automaticRules.removeAt(i);
                }
            }