OSDN Git Service

Mark app pending intents in notification extras
authorSvet Ganov <svetoslavganov@google.com>
Fri, 24 Jun 2016 02:55:24 +0000 (19:55 -0700)
committerSvet Ganov <svetoslavganov@google.com>
Tue, 28 Jun 2016 00:32:25 +0000 (17:32 -0700)
commitddb948896ca7059161e09d0063b3332352772c0a
tree77ba9f585ff20ae36a1e056bf1743b3d5d689d18
parent5836c9e658dd63f2e1ba505155bf66bff41a9f85
Mark app pending intents in notification extras

We need to make every peniding intent that went in the notification
system to allow special handling of such intents when fired by a
notification listener. If a pending intent from a notification
is sent from a notification listener, we white-list the source app
to run in data saver mode for a short period of time. The problem is
that actions and the notificaion can have extras which bundles may
contain pending intents but the system cannot look into the bundles
as they may contain custom parcelable objects. To address this we
keep a list of all pending intents in the notification allowing
the system to access them without touching the bundle. Currently
the pending intents are written to the parcel twice, once in the
bundle and once as the explicit list. We can come up with a scheme
to optimize this but since pending itents are just a binder pointer
it is not worth the excecise.

bug:29480440

Change-Id: I7328a47017ca226117adf7054900836619f5679b
core/java/android/app/Notification.java
core/java/android/app/PendingIntent.java
core/java/android/os/Parcel.java
core/java/android/util/ArraySet.java
services/core/java/com/android/server/notification/NotificationManagerService.java