diff options
author | Wenyi Wang <wenyiw@google.com> | 2017-03-23 14:02:46 -0700 |
---|---|---|
committer | Wenyi Wang <wenyiw@google.com> | 2017-03-23 14:50:22 -0700 |
commit | 156fc9f68761dd3eeb6fb3d154fc35a201991ebb (patch) | |
tree | b89bb46a56a66fd2376496d9ac13544f27a9cbd1 /src/com/android/contacts/vcard/NotificationImportExportListener.java | |
parent | 1aa5775c6da7cf5d5b7ea521baf71f156c82f8af (diff) | |
download | android_packages_apps_Contacts-156fc9f68761dd3eeb6fb3d154fc35a201991ebb.tar.gz android_packages_apps_Contacts-156fc9f68761dd3eeb6fb3d154fc35a201991ebb.tar.bz2 android_packages_apps_Contacts-156fc9f68761dd3eeb6fb3d154fc35a201991ebb.zip |
Create channel if channel is not available
Bug: 36530928
Test: follow steps to repro in http://b/36530928#comment2
and make sure no crash is seen when importing from SIM or Vcard.
Also hard code to stop listening for ACTION_BOOT_COMPLETED and
make sure channel is created before setting channel;
Change-Id: Ib061e299082670c24a0e248da5a61285cd944ea6
Diffstat (limited to 'src/com/android/contacts/vcard/NotificationImportExportListener.java')
-rw-r--r-- | src/com/android/contacts/vcard/NotificationImportExportListener.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/contacts/vcard/NotificationImportExportListener.java b/src/com/android/contacts/vcard/NotificationImportExportListener.java index f4d682ca0..daac5cb8a 100644 --- a/src/com/android/contacts/vcard/NotificationImportExportListener.java +++ b/src/com/android/contacts/vcard/NotificationImportExportListener.java @@ -220,6 +220,7 @@ public class NotificationImportExportListener implements VCardImportExportListen .appendQueryParameter(CancelActivity.TYPE, String.valueOf(type)).build(); intent.setData(uri); + ContactsNotificationChannelsUtil.createDefaultChannel(context); final NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setOngoing(true) .setChannel(ContactsNotificationChannelsUtil.DEFAULT_CHANNEL) @@ -247,6 +248,7 @@ public class NotificationImportExportListener implements VCardImportExportListen */ /* package */ static Notification constructCancelNotification( Context context, String description) { + ContactsNotificationChannelsUtil.createDefaultChannel(context); return new NotificationCompat.Builder(context) .setChannel(ContactsNotificationChannelsUtil.DEFAULT_CHANNEL) .setAutoCancel(true) @@ -278,6 +280,7 @@ public class NotificationImportExportListener implements VCardImportExportListen */ /* package */ static Notification constructFinishNotificationWithFlags( Context context, String title, String description, Intent intent, int flags) { + ContactsNotificationChannelsUtil.createDefaultChannel(context); return new NotificationCompat.Builder(context) .setChannel(ContactsNotificationChannelsUtil.DEFAULT_CHANNEL) .setAutoCancel(true) @@ -302,6 +305,7 @@ public class NotificationImportExportListener implements VCardImportExportListen */ /* package */ static Notification constructImportFailureNotification( Context context, String reason) { + ContactsNotificationChannelsUtil.createDefaultChannel(context); return new NotificationCompat.Builder(context) .setChannel(ContactsNotificationChannelsUtil.DEFAULT_CHANNEL) .setAutoCancel(true) |