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

Commit 97b88798 authored by Chen Xu's avatar Chen Xu Committed by android-build-merger
Browse files

Merge "downgrade roaming notification channel importance" into oc-dr1-dev

am: c735cc38

Change-Id: I0c83f63917b09af04da39d36441509e4f36ce0b5
parents 7bd94431 c735cc38
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.telephony.SubscriptionManager;
import com.android.internal.R;

import java.util.Arrays;
import java.util.List;


public class NotificationChannelController {
@@ -39,11 +38,14 @@ public class NotificationChannelController {
     */
    public static final String CHANNEL_ID_ALERT = "alert";
    public static final String CHANNEL_ID_CALL_FORWARD = "callForward";
    public static final String CHANNEL_ID_MOBILE_DATA_ALERT = "mobileDataAlert";
    public static final String CHANNEL_ID_MOBILE_DATA_ALERT = "mobileDataAlertNew";
    public static final String CHANNEL_ID_SMS = "sms";
    public static final String CHANNEL_ID_VOICE_MAIL = "voiceMail";
    public static final String CHANNEL_ID_WFC = "wfc";

    /** deprecated channel, replaced with @see #CHANNEL_ID_MOBILE_DATA_ALERT */
    private static final String CHANNEL_ID_MOBILE_DATA_ALERT_DEPRECATED = "mobileDataAlert";

    /**
     * Creates all notification channels and registers with NotificationManager. If a channel
     * with the same ID is already registered, NotificationManager will ignore this call.
@@ -63,7 +65,7 @@ public class NotificationChannelController {
                        NotificationManager.IMPORTANCE_LOW),
                new NotificationChannel(CHANNEL_ID_MOBILE_DATA_ALERT,
                        context.getText(R.string.notification_channel_mobile_data_alert),
                        NotificationManager.IMPORTANCE_DEFAULT),
                        NotificationManager.IMPORTANCE_LOW),
                new NotificationChannel(CHANNEL_ID_SMS,
                        context.getText(R.string.notification_channel_sms),
                        NotificationManager.IMPORTANCE_HIGH),
@@ -75,6 +77,12 @@ public class NotificationChannelController {
        if (getChannel(CHANNEL_ID_VOICE_MAIL, context) != null) {
            migrateVoicemailNotificationSettings(context);
        }
        // after channel has been created there is no way to change the channel setting
        // programmatically. delete the old channel and create a new one with a new ID.
        if (getChannel(CHANNEL_ID_MOBILE_DATA_ALERT_DEPRECATED, context) != null) {
            context.getSystemService(NotificationManager.class)
                    .deleteNotificationChannel(CHANNEL_ID_MOBILE_DATA_ALERT_DEPRECATED);
        }
    }

    public NotificationChannelController(Context context) {