Messaging: Add notification channels where missing
Change-Id: I1cb3177704542fc48c42dc18a9e1f4d3118d4193
diff --git a/src/com/android/messaging/datamodel/MessageNotificationState.java b/src/com/android/messaging/datamodel/MessageNotificationState.java
index 4a4bfd5..fd82f74 100644
--- a/src/com/android/messaging/datamodel/MessageNotificationState.java
+++ b/src/com/android/messaging/datamodel/MessageNotificationState.java
@@ -55,6 +55,7 @@
import com.android.messaging.util.ContentType;
import com.android.messaging.util.ConversationIdSet;
import com.android.messaging.util.LogUtil;
+import com.android.messaging.util.NotificationsUtil;
import com.android.messaging.util.PendingIntentConstants;
import com.android.messaging.util.UriUtil;
import com.google.common.collect.Lists;
@@ -774,7 +775,8 @@
bigText.append("\n\n").append(statusText);
}
- final NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context);
+ final NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context,
+ NotificationsUtil.DEFAULT_CHANNEL_ID);
final NotificationCompat.Style notifStyle =
new NotificationCompat.BigTextStyle(notifBuilder).bigText(bigText);
notifBuilder.setStyle(notifStyle);
@@ -1196,7 +1198,8 @@
}
if (failedMessages.size() > 0) {
final NotificationCompat.Builder builder =
- new NotificationCompat.Builder(context);
+ new NotificationCompat.Builder(context,
+ NotificationsUtil.DEFAULT_CHANNEL_ID);
CharSequence line1;
CharSequence line2;
diff --git a/src/com/android/messaging/receiver/SmsReceiver.java b/src/com/android/messaging/receiver/SmsReceiver.java
index c36e9ab..89a3710 100644
--- a/src/com/android/messaging/receiver/SmsReceiver.java
+++ b/src/com/android/messaging/receiver/SmsReceiver.java
@@ -48,6 +48,7 @@
import com.android.messaging.util.BugleGservicesKeys;
import com.android.messaging.util.DebugUtils;
import com.android.messaging.util.LogUtil;
+import com.android.messaging.util.NotificationsUtil;
import com.android.messaging.util.OsUtil;
import com.android.messaging.util.PendingIntentConstants;
import com.android.messaging.util.PhoneUtils;
@@ -260,7 +261,8 @@
final PendingIntent pendingIntent = UIIntents.get()
.getPendingIntentForSecondaryUserNewMessageNotification(context);
- final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
+ final NotificationCompat.Builder builder = new NotificationCompat.Builder(context,
+ NotificationsUtil.DEFAULT_CHANNEL_ID);
builder.setContentTitle(resources.getString(R.string.secondary_user_new_message_title))
.setTicker(resources.getString(R.string.secondary_user_new_message_ticker))
.setSmallIcon(R.drawable.ic_sms_light)
diff --git a/src/com/android/messaging/sms/SmsStorageStatusManager.java b/src/com/android/messaging/sms/SmsStorageStatusManager.java
index 4f03195..6bd68cb 100644
--- a/src/com/android/messaging/sms/SmsStorageStatusManager.java
+++ b/src/com/android/messaging/sms/SmsStorageStatusManager.java
@@ -25,6 +25,7 @@
import com.android.messaging.Factory;
import com.android.messaging.R;
import com.android.messaging.ui.UIIntents;
+import com.android.messaging.util.NotificationsUtil;
import com.android.messaging.util.PendingIntentConstants;
import com.android.messaging.util.PhoneUtils;
@@ -65,7 +66,8 @@
final PendingIntent pendingIntent = UIIntents.get()
.getPendingIntentForLowStorageNotifications(context);
- final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
+ final NotificationCompat.Builder builder = new NotificationCompat.Builder(context,
+ NotificationsUtil.DEFAULT_CHANNEL_ID);
builder.setContentTitle(resources.getString(R.string.sms_storage_low_title))
.setTicker(resources.getString(R.string.sms_storage_low_notification_ticker))
.setSmallIcon(R.drawable.ic_failed_light)