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

Commit d3a670bf authored by Matías Hernández's avatar Matías Hernández Committed by Android (Google) Code Review
Browse files

Merge "Add (hidden) setPackage() in AZR.Builder" into main

parents 37190709 f3484fae
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -843,6 +843,15 @@ public final class AutomaticZenRule implements Parcelable {
            return this;
        }

        /**
         * Sets the package that owns this rule
         * @hide
         */
        public @NonNull Builder setPackage(@NonNull String pkg) {
            mPkg = pkg;
            return this;
        }

        public @NonNull AutomaticZenRule build() {
            AutomaticZenRule rule = new AutomaticZenRule(mName, mOwner, mConfigurationActivity,
                    mConditionId, mPolicy, mInterruptionFilter, mEnabled);
+2 −1
Original line number Diff line number Diff line
@@ -1446,6 +1446,7 @@ public class ZenModeHelper {
        if (Flags.modesApi()) {
            azr = new AutomaticZenRule.Builder(rule.name, rule.conditionId)
                    .setManualInvocationAllowed(rule.allowManualInvocation)
                    .setPackage(rule.pkg)
                    .setCreationTime(rule.creationTime)
                    .setIconResId(drawableResNameToResId(rule.pkg, rule.iconResName))
                    .setType(rule.type)
@@ -1464,8 +1465,8 @@ public class ZenModeHelper {
                    rule.conditionId, rule.zenPolicy,
                    NotificationManager.zenModeToInterruptionFilter(rule.zenMode),
                    rule.enabled, rule.creationTime);
        }
            azr.setPackageName(rule.pkg);
        }
        return azr;
    }