Commit 8ac243bc authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Notification scheduler: Close notification after clicks.

This CL adds the logic to close notification after clicks. This can be
the default behavior built in to the system. If any notification types
want custom behavior, we can tweak the logic for them later.

Bug: 987830
Change-Id: Ib7c0d722dabf5757dda718d40b408fea0113d73f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1802519Reviewed-by: default avatarHesen Zhang <hesen@chromium.org>
Commit-Queue: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696896}
parent e1e8c231
......@@ -189,6 +189,7 @@ public class DisplayAgent {
case NotificationIntentInterceptor.IntentType.CONTENT_INTENT:
DisplayAgentJni.get().onUserAction(Profile.getLastUsedProfile(), clientType,
UserActionType.CLICK, guid, ActionButtonType.UNKNOWN_ACTION, null);
closeNotification(guid);
break;
case NotificationIntentInterceptor.IntentType.DELETE_INTENT:
DisplayAgentJni.get().onUserAction(Profile.getLastUsedProfile(), clientType,
......@@ -200,10 +201,16 @@ public class DisplayAgent {
String buttonId = IntentUtils.safeGetStringExtra(intent, EXTRA_ACTION_BUTTON_ID);
DisplayAgentJni.get().onUserAction(Profile.getLastUsedProfile(), clientType,
UserActionType.BUTTON_CLICK, guid, actionButtonType, buttonId);
closeNotification(guid);
break;
}
}
private static void closeNotification(String guid) {
new NotificationManagerProxyImpl(ContextUtils.getApplicationContext())
.cancel(DISPLAY_AGENT_TAG, guid.hashCode());
}
/**
* Contains Android platform specific data to construct a notification.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment