Revert "Messaging: Add "Mark as read" quick action for message notifications"
This reverts commit f19e916a0d.
Reason for revert: Reverting per Taesu Lee's comments, because it doesn't work and has issues.
Change-Id: I778362b628f4c3ae076dd943e77dee415984fba0
This commit is contained in:
@@ -833,8 +833,7 @@ public class BugleNotifications {
|
||||
maybeAddWearableConversationLog(wearableExtender,
|
||||
(MultiMessageNotificationState) notificationState);
|
||||
addDownloadMmsAction(notifBuilder, wearableExtender, notificationState);
|
||||
addReplyAction(notifBuilder, wearableExtender, notificationState);
|
||||
addReadAction(notifBuilder, wearableExtender, notificationState);
|
||||
addWearableVoiceReplyAction(wearableExtender, notificationState);
|
||||
}
|
||||
|
||||
// Apply the wearable options and build & post the notification
|
||||
@@ -876,7 +875,7 @@ public class BugleNotifications {
|
||||
}
|
||||
}
|
||||
|
||||
private static void addReplyAction(final NotificationCompat.Builder notifBuilder,
|
||||
private static void addWearableVoiceReplyAction(
|
||||
final WearableExtender wearableExtender, final NotificationState notificationState) {
|
||||
if (!(notificationState instanceof MultiMessageNotificationState)) {
|
||||
return;
|
||||
@@ -913,25 +912,9 @@ public class BugleNotifications {
|
||||
setChoices(choices)
|
||||
.build();
|
||||
actionBuilder.addRemoteInput(remoteInput);
|
||||
notifBuilder.addAction(actionBuilder.build());
|
||||
|
||||
// Support the action on a wearable device as well
|
||||
wearableExtender.addAction(actionBuilder.build());
|
||||
}
|
||||
|
||||
private static void addReadAction(final NotificationCompat.Builder notifBuilder,
|
||||
final WearableExtender wearableExtender, final NotificationState notificationState) {
|
||||
final Context context = Factory.get().getApplicationContext();
|
||||
final PendingIntent readPendingIntent = notificationState.getReadIntent();
|
||||
final NotificationCompat.Action.Builder readActionBuilder =
|
||||
new NotificationCompat.Action.Builder(R.drawable.ic_wear_read,
|
||||
context.getString(R.string.notification_mark_as_read), readPendingIntent);
|
||||
notifBuilder.addAction(readActionBuilder.build());
|
||||
|
||||
// Support the action on a wearable device as well
|
||||
wearableExtender.addAction(readActionBuilder.build());
|
||||
}
|
||||
|
||||
private static void addDownloadMmsAction(final NotificationCompat.Builder notifBuilder,
|
||||
final WearableExtender wearableExtender, final NotificationState notificationState) {
|
||||
if (!(notificationState instanceof MultiMessageNotificationState)) {
|
||||
|
||||
@@ -349,14 +349,6 @@ public abstract class MessageNotificationState extends NotificationState {
|
||||
getClearIntentRequestCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PendingIntent getReadIntent() {
|
||||
return UIIntents.get().getPendingIntentForMarkingAsRead(
|
||||
Factory.get().getApplicationContext(),
|
||||
mConversationIds,
|
||||
getReadIntentRequestCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification for multiple messages in at least 2 different conversations.
|
||||
*/
|
||||
|
||||
@@ -43,8 +43,7 @@ import java.util.HashSet;
|
||||
public abstract class NotificationState {
|
||||
private static final int CONTENT_INTENT_REQUEST_CODE_OFFSET = 0;
|
||||
private static final int CLEAR_INTENT_REQUEST_CODE_OFFSET = 1;
|
||||
private static final int READ_INTENT_REQUEST_CODE_OFFSET = 2;
|
||||
private static final int NUM_REQUEST_CODES_NEEDED = 3;
|
||||
private static final int NUM_REQUEST_CODES_NEEDED = 2;
|
||||
|
||||
public interface FailedMessageQuery {
|
||||
static final String FAILED_MESSAGES_WHERE_CLAUSE =
|
||||
@@ -79,11 +78,6 @@ public abstract class NotificationState {
|
||||
*/
|
||||
public abstract PendingIntent getClearIntent();
|
||||
|
||||
/**
|
||||
* The intent to be triggered when mark as read is pressed.
|
||||
*/
|
||||
public abstract PendingIntent getReadIntent();
|
||||
|
||||
protected Uri getAttachmentUri() {
|
||||
return null;
|
||||
}
|
||||
@@ -122,10 +116,6 @@ public abstract class NotificationState {
|
||||
return mBaseRequestCode + CLEAR_INTENT_REQUEST_CODE_OFFSET;
|
||||
}
|
||||
|
||||
public int getReadIntentRequestCode() {
|
||||
return mBaseRequestCode + READ_INTENT_REQUEST_CODE_OFFSET;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the appropriate icon needed for notifications.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user