From af02489b7134fcfe5db9d975bee11912adca74ff Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Mon, 3 Sep 2018 21:34:48 -0400 Subject: [PATCH] Remove reply suggestions on P notifications --- .../com/moez/QKSMS/common/util/NotificationManagerImpl.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/presentation/src/main/java/com/moez/QKSMS/common/util/NotificationManagerImpl.kt b/presentation/src/main/java/com/moez/QKSMS/common/util/NotificationManagerImpl.kt index e146a58b..5d16ac12 100644 --- a/presentation/src/main/java/com/moez/QKSMS/common/util/NotificationManagerImpl.kt +++ b/presentation/src/main/java/com/moez/QKSMS/common/util/NotificationManagerImpl.kt @@ -298,12 +298,14 @@ class NotificationManagerImpl @Inject constructor( val responseSet = context.resources.getStringArray(R.array.qk_responses) val remoteInput = RemoteInput.Builder("body") .setLabel(title) - .setChoices(responseSet) - .build() + + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { + remoteInput.setChoices(responseSet) + } return NotificationCompat.Action.Builder(R.drawable.ic_reply_white_24dp, title, replyPI) .setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_REPLY) - .addRemoteInput(remoteInput) + .addRemoteInput(remoteInput.build()) .build() }