Messaging: Add "Mark as read" quick action for message notifications

Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Change-Id: I7194dca022e5062926fa35709de282721ca64320
This commit is contained in:
Paul Keith
2018-10-30 15:46:18 +01:00
committed by Luca Stefani
parent 1dc43f0e09
commit f19e916a0d
8 changed files with 85 additions and 4 deletions

View File

@@ -431,6 +431,20 @@ public class UIIntentsImpl extends UIIntents {
PendingIntent.FLAG_UPDATE_CURRENT);
}
@Override
public PendingIntent getPendingIntentForMarkingAsRead(final Context context,
final ConversationIdSet conversationIdSet, final int requestCode) {
final Intent intent = new Intent(context, NotificationReceiver.class);
intent.setAction(ACTION_MARK_AS_READ);
if (conversationIdSet != null) {
intent.putExtra(UI_INTENT_EXTRA_CONVERSATION_ID_SET,
conversationIdSet.getDelimitedString());
}
return PendingIntent.getBroadcast(context,
requestCode, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
}
/**
* Gets a PendingIntent associated with an Intent to start an Activity. All notifications
* that starts an Activity must use this method to get a PendingIntent, which achieves two