001// SPDX-License-Identifier: GPL-3.0-or-later
002// Copyright © 2026 Aurélien Pierre
003
004package com.aurelienpierre.sioul;
005
006import android.app.NotificationChannel;
007
008/**
009 * Sioul's notification channels, every one made here: without a badge on
010 * Sioul's icon, neither the launcher's dot nor a count (docs/design.md: no
011 * badges, no counts). Android keeps a channel's badge as the channel was
012 * first made, and takes no change of it afterwards: a channel an older Sioul
013 * made with its badge keeps it until you switch it off in Android's settings
014 * (Sioul, Notifications, its category).
015 * Checked on a JVM (android/jvm-checks/ChannelsCheck.java): no other place
016 * makes a channel.
017 */
018final class Channels
019{
020    private Channels() {}
021
022    /**
023     * A channel to hand to NotificationManager.createNotificationChannel,
024     * its badge off; the rest (sound, vibration, do-not-disturb) set by the caller.
025     *
026     * @param id the channel's id, kept for good
027     * @param name its name, as Android's settings show it
028     * @param importance NotificationManager's importance
029     * @return the channel, not yet made
030     */
031    static NotificationChannel quiet(String id, CharSequence name, int importance)
032    {
033        NotificationChannel channel = new NotificationChannel(id, name, importance);
034        channel.setShowBadge(false);
035        return channel;
036    }
037}