Commit d74b2106 authored by Peter Beverloo's avatar Peter Beverloo Committed by Commit Bot

Copy the notification's scope in the NotificationJobService

The NotificationJobService needs to copy the data stored in a
notification's PendingIntent to one that is safe to be used for starting
a background job. It did so for most data members, but not for the
scope.

Bug: 824729
Change-Id: Ifbb7d8b22e15074545fd756a012f84f6a17b68e1
Reviewed-on: https://chromium-review.googlesource.com/975128
Commit-Queue: Peter Beverloo <peter@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545054}
parent 1148673c
...@@ -27,6 +27,8 @@ public class NotificationJobService extends JobService { ...@@ -27,6 +27,8 @@ public class NotificationJobService extends JobService {
intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_ID)); intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_ID));
bundle.putString(NotificationConstants.EXTRA_NOTIFICATION_INFO_ORIGIN, bundle.putString(NotificationConstants.EXTRA_NOTIFICATION_INFO_ORIGIN,
intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_ORIGIN)); intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_ORIGIN));
bundle.putString(NotificationConstants.EXTRA_NOTIFICATION_INFO_SCOPE,
intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_SCOPE));
bundle.putString(NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_ID, bundle.putString(NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_ID,
intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_ID)); intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_ID));
bundle.putBoolean(NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_INCOGNITO, bundle.putBoolean(NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_INCOGNITO,
......
...@@ -327,6 +327,9 @@ public class NotificationPlatformBridge { ...@@ -327,6 +327,9 @@ public class NotificationPlatformBridge {
Uri intentData = makeIntentData(notificationId, origin, actionIndex); Uri intentData = makeIntentData(notificationId, origin, actionIndex);
Intent intent = new Intent(action, intentData); Intent intent = new Intent(action, intentData);
intent.setClass(context, NotificationService.Receiver.class); intent.setClass(context, NotificationService.Receiver.class);
// Make sure to update NotificationJobService.getJobExtrasFromIntent() when changing any
// of the extras included with the |intent|.
intent.putExtra(NotificationConstants.EXTRA_NOTIFICATION_ID, notificationId); intent.putExtra(NotificationConstants.EXTRA_NOTIFICATION_ID, notificationId);
intent.putExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_ORIGIN, origin); intent.putExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_ORIGIN, origin);
intent.putExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_SCOPE, scopeUrl); intent.putExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_SCOPE, scopeUrl);
......
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