Loading src/java/com/android/internal/telephony/util/NotificationChannelController.java +11 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.telephony.SubscriptionManager; import com.android.internal.R; import java.util.Arrays; import java.util.List; public class NotificationChannelController { Loading @@ -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. Loading @@ -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), Loading @@ -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) { Loading Loading
src/java/com/android/internal/telephony/util/NotificationChannelController.java +11 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.telephony.SubscriptionManager; import com.android.internal.R; import java.util.Arrays; import java.util.List; public class NotificationChannelController { Loading @@ -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. Loading @@ -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), Loading @@ -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) { Loading