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

Commit 1873f2ec authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Generate sequential instead of random rule ids in TestModeBuilder" into main

parents de851127 bab932f2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -33,10 +33,12 @@ import android.service.notification.ZenPolicy;
import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;

import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;

public class TestModeBuilder {

    private static final AtomicInteger sNextId = new AtomicInteger(0);

    private String mId;
    private AutomaticZenRule mRule;
    private ZenModeConfig.ZenRule mConfigZenRule;
@@ -47,7 +49,7 @@ public class TestModeBuilder {

    public TestModeBuilder() {
        // Reasonable defaults
        int id = new Random().nextInt(1000);
        int id = sNextId.incrementAndGet();
        mId = "rule_" + id;
        mRule = new AutomaticZenRule.Builder("Test Rule #" + id, Uri.parse("rule://" + id))
                .setPackage("some_package")