History log of /frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1d35979f0ada629f192eb1078a29f6eae2c71745 13-Jan-2017 Selim Cinek <cinek@google.com> Not allowing foreground services to be cleared as children

forground service notifications could simply be cleared
when they were sent as notification children and then
the summary was cancelled.

This also cleans up the logic in systemui and only removes
the child if allowed.

The clear all button could also show under certain conditions
where it shouldn't have been shown.

Change-Id: I85998b5342bd75425cc6d68e96391299c4f3d83d
Test: manual
Bug: 33766648
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ef89d21a1bf9a8b11befd9b55130816ccf9fb4fb 20-Sep-2016 Wei Liu <luciferleo@google.com> Make VrManager service optional.

b/31244699

Change-Id: I7d276e6945f19b575f880df16f140b84b03052a9
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
aa07653d2eea38a7a5bda5944c8a353586916ae9 02-Aug-2016 Svetoslav Ganov <svetoslavganov@google.com> Prevent apps to overlay other apps via toast windows

It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout.

Now for apps targeting SDK greater than N MR1 to add a
toast window one needs to have a special token. The token
is added by the notificatoion manager service only for
the lifetime of the shown toast and is then removed
including all windows associated with this token. This
prevents apps to add arbitrary toast windows.

Since legacy apps may rely on the ability to directly
add toasts we mitigate by allowing these apps to still
add such windows for unlimited duration if this app is
the currently focused one, i.e. the user interacts with
it then it can overlay itself, otherwise we make sure
these toast windows are removed after a timeout like
a toast would be.

We don't allow more that one toast window per UID being
added at a time which prevents 1) legacy apps to put the
same toast after a timeout to go around our new policy
of hiding toasts after a while; 2) modern apps to reuse
the passed token to add more than one window; Note that
the notification manager shows toasts one at a time.

bug:30150688

Change-Id: Ia1dae626bd9e22541be46edb072aa288eb1ae414
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
6434eb2e041946ec7acce41b7b76f12548f0d4e3 08-Aug-2016 Julia Reynolds <juliacr@google.com> Clean up zen rules and permissions immediately on uninstall.

Change-Id: I8d03f4a4347b7d7bffbe267961c75ed5863a4113
Fixes: 30740759
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a61f179c3d95e2b04b82dcc4ef824be1f6c4690a 04-Aug-2016 Chris Wren <cwren@android.com> only rate limit notification updates

Updates to progress bars are the main culprit in system
performance events caused by apps spamming the notification
service. Rate-limiting only updates allows us to set a lower
threshold wihtout the owrry of mistakenly dropping bursts of
notifications being quickly posted after a network sync.

Also reduce logspam caused by the rate-limit events.

Bug: 30132961
Change-Id: I49acda6a2831204da45e899ddd3d62d571d7174b
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
2fc661a453c8dd0f62c4e567641ab282f2f2c5fe 02-Aug-2016 Svetoslav Ganov <svetoslavganov@google.com> Revert "Prevent apps to overlay other apps via toast windows"

bug:30150688

This reverts commit dc24f937b031f5f4e153dbfeaa51e96415a09b71.

Change-Id: Id7e8ddbf82ab426f55a5296791f1e8ebb61514bc
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
dc24f937b031f5f4e153dbfeaa51e96415a09b71 26-Jul-2016 Svet Ganov <svetoslavganov@google.com> Prevent apps to overlay other apps via toast windows

It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout.

Now for apps targeting SDK greater than N MR1 to add a
toast window one needs to have a special token. The token
is added by the notificatoion manager service only for
the lifetime of the shown toast and is then removed
including all windows associated with this token. This
prevents apps to add arbitrary toast windows.

Since legacy apps may rely on the ability to directly
add toasts we mitigate by allowing these apps to still
add such windows for unlimited duration if this app is
the currently focused one, i.e. the user interacts with
it then it can overlay itself, otherwise we make sure
these toast windows are removed after a timeout like
a toast would be.

We don't allow more that one toast window per UID being
added at a time which prevents 1) legacy apps to put the
same toast after a timeout to go around our new policy
of hiding toasts after a while; 2) modern apps to reuse
the passed token to add more than one window; Note that
the notification manager shows toasts one at a time.

bug:30150688

Change-Id: Icc8f8dbd060762ae1a7b1720e96c5afdb8aff3fd
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
78fa7a1b3f8a5a227807f426a5d4fdc2a26e7998 20-Jul-2016 Svetoslav Ganov <svetoslavganov@google.com> Merge "Revert "Prevent apps to overlay other apps via toast windows"" into nyc-mr1-dev
f1395d730a499b6420ee7593f3a5236eca637bfb 20-Jul-2016 Svetoslav Ganov <svetoslavganov@google.com> Revert "Prevent apps to overlay other apps via toast windows"

This reverts commit b3b22cba86dd6e010c5fac3d044990f155a33381.

Change-Id: I905e7435893fab49f03fdb708f4ab5a9d2c9cbae
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
c6b371b65935763d0d00711ed71db4a9d3620ae0 14-Jun-2016 Julia Reynolds <juliacr@google.com> Prevent notifications from erroroneously bypassing 'repeat callers' filter

1. Dialer uses a hidden api to check 'is repeat caller' that has side
effects. Update to use a method without side effects
2. Delay the storage of person information until the notification is
canceled, so ranking updates and notification updates don't bypass the
filter. Note, this means that someone calling twice at overlapping
times (?!) wouldn't get through the filter.

Fixes: 29184211
Change-Id: I53ce402a0ed6f5df6f8265d571d401778dacebd3
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b3b22cba86dd6e010c5fac3d044990f155a33381 15-Jul-2016 Svet Ganov <svetoslavganov@google.com> Prevent apps to overlay other apps via toast windows

It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout like toasts are.

Now to add a toast window one needs to have a special
token. The token is added by the notificatoion manager
service only for the lifetime of the shown toast and
is then removed including all windows associated with
this token.

This prevents apps to add arbitrary toast windows. The
token is passed in the app domain in the request to
construt and add the toast window which allows a bad
app to add arbitrary toast windows. However, this is
fine since the token will be invalided and all of its
windows removed after the toast for which it was
create times out.

We do not care of braking apps that add toast windows
directly due to the security and privacy implications
of arbitrary UI redressing. Also we have dedicated
Toast APIs which are the way to add this time of UI.

bug:30150688

Change-Id: I65372c81a791489de89fb2886cc96392c28680bb
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
44ad6ff4c2162842335372060ad6a34fabc8b29d 06-Jul-2016 Julia Reynolds <juliacr@google.com> Attribute manual zen mode in volume panel footer.

So users know what app enabled DND.

Change-Id: I0aad862539b28302bf618641ad29cdfa956c8f33
Fixes: 29892371
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
2960700fcdcfd81aa0b0960c3a5416eebd445e68 06-Jul-2016 Julia Reynolds <juliacr@google.com> Don't bridge autobundle summaries to other devices.

Change-Id: I2d0df16b2fbd32569e564399696c86e499910ddb
Fixes: 29114754
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
0cd1b789567b60b963fc7b8935e898ea0e61a617 29-Jun-2016 Julia Reynolds <juliacr@google.com> Check uid for notification policy access.

Bug: 29421441
Change-Id: Ia0a7b06112dde1c925ec3232f50bf4d90b17b5e5
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1cec26c69e5ecd33d634996b05db8b0b3467b9f0 28-Jun-2016 Felipe Leme <felipeal@google.com> Merge \"Remove redundant setPendingIntentWhitelistDuration() calls.\" into nyc-dev
am: c1374208e3

Change-Id: Ie02a847ac513f89c1c430af0e3f559cf0bc2039d
dd85da6e94fc7fd239fd97b954c1c78e66b265d6 28-Jun-2016 Felipe Leme <felipeal@google.com> Remove redundant setPendingIntentWhitelistDuration() calls.

Since all pending intents are stored on a Set in the Notication object,
there is no need to individually check for specific pending intents.

BUG: 29480440
Change-Id: I27a18bb535a9a4bb6cb4e76bdc189e6c315a684a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
7878e736f7d3e99829453684c30f4b673e71c1fd 28-Jun-2016 Svet Ganov <svetoslavganov@google.com> Merge \"Mark app pending intents in notification extras\" into nyc-dev
am: b2cd9c95bf

Change-Id: Idb515255f224c23d60a513713d9e4f93decd7a9c
ddb948896ca7059161e09d0063b3332352772c0a 24-Jun-2016 Svet Ganov <svetoslavganov@google.com> 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
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d405431bc97087184d1ecb77e4fa495a6ca4709a 24-Jun-2016 Chris Wren <cwren@android.com> use an observer for the default sound

matches other settings use, and also improves testability of buzzbeepblink

Change-Id: I9445448c4c4f24f4f49f7cb1fdcd2f5362944606
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
00d9d9f11e7645059b8dbce4d80e8fc7ca5312d0 21-Jun-2016 Julia Reynolds <juliacr@google.com> Don't iterate over a list items are removed from.

Change-Id: I896cd4578da15e21d422ca8db42e34bbd10912e8
Fixes: 29512540
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1e7d8d381768ddb8868ba50612a1e48d44bfce6f 21-Jun-2016 Selim Cinek <cinek@google.com> Merge "Fixed an issue where the deleteintent of children wasn't sent" into nyc-dev
ce87a8af9dbf8ee6fb1a40a41451e89bb40246c2 21-Jun-2016 Selim Cinek <cinek@google.com> Fixed an issue where the deleteintent of children wasn't sent

Especially in context of autobundling this could lead to bad bugs

Change-Id: Idf722f9675f6f6e49d49c08798e38e09b1c5c01e
Fixes: 29515621
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
888b7a8faf7d6c2aa4272bebeb875eac9a2ff21c 17-Jun-2016 Chris Wren <cwren@android.com> assume a generous prior in the rate estimator

currently with one data point the estimator is biased high. If we don't
have any data we want to be biased low to allow the first interaction
to be an isolated burst.

Also add metrics for enqueue rate to make it easier to debug this
code in the future (currently we only have metrics after the
rate limiter).

Bug: 29379789
Change-Id: I7b1d379290a55f120d039fd29d1bc0abbc6d4932
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
75aa534d3aafe17a912b2c2734bee9a76b1edd83 16-Jun-2016 Felipe Leme <felipeal@google.com> Check extra type before blindingly casting to Parcelable.

BUG: 29402928
Change-Id: If1729b8a4fcde724372b0a23cfae723a5d9b4faa
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
43c3a7e5a781640b862cf6f51805b3823f46fd02 02-Jun-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "make the notification enqueue rate threshold a setting" into nyc-dev
763a9bb09518884c42abe90c1553bc07c0872879 31-May-2016 Chris Wren <cwren@android.com> make the notification enqueue rate threshold a setting

Bug: 28693065
Change-Id: I08bd2ed342d5347c0075183b239558c50ada4a0a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
2608cc891ddb989d2ba604fe556eeb5080bbf51b 28-May-2016 Adrian Roos <roosa@google.com> Fix crash with intent-less actions

Follow-up to I00d46036a2cbb73f7f733fd35bf0b743a02807a1

Bug: 28818704
Change-Id: I9a444b9dd4cea92b4a770d7051c05c48818892ad
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a1b79bfd7a15006a93da933695359765e0fee495 24-May-2016 Felipe Leme <felipeal@google.com> Allow apps to bypass Power Save restrictions when launched from a Notification's PendingIntent.

This scenario typically happens when the device is on Doze Mode and a
notification action is triggered from a Wear device.

In a nutshell, the workflow is:

- ProcessRecord has a flag telling whether a process has "whitelist
management" privileges.
- When NotificationManager binds a new NotificationListenerService, it
sets the BIND_ALLOW_WHITELIST_MANAGEMENT flag.
- On bind(), ActiveService asserts that only system apps can set that
flag.
- On computeOomAdjLocked(), ActivityManagerService sets the
ProcessRecord flag if necessary.
- Upon creating a notification, NotificationManager calls AM to mark its
PendingIntents as coming from a notification.
- When PendingIntentRecord sends it to the target, it checks if it's
from a notification and if so calls AM to do the temp whitelist.
- On unbind(), ActiveService removes the ProcessRecord flag if necessary.

Fixes: 28818704

Change-Id: I00d46036a2cbb73f7f733fd35bf0b743a02807a1
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ad92957ee31c756d3f2b3ada45357e4a180e82e3 26-May-2016 Julia Reynolds <juliacr@google.com> Unlocked access of mServices is bad.

Change-Id: I626d2daffb3669c7bea4856f8ee66dbd13951163
Fixes: 28979051
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
3011fd4dbd4585917af71e109353e6e02332ef5b 20-May-2016 Julia Reynolds <juliacr@google.com> Set autobundled summary color.

Change-Id: I8ceb0b045359dc364fcec411fcfc610f7f57d8db
Fixes: 28615262
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
585ff8bd126ffac98164a87d24a9add5c23f9597 20-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "rate limit notification enqueues" into nyc-dev
c8673a88fed53715d2295a535535c7ce7acbe7b6 17-May-2016 Chris Wren <cwren@android.com> rate limit notification enqueues

This is distinct from and in addition to the limit on the number of
distinct notifications. This includes many updates to a single
notification.

Bug: 28693065
Change-Id: I5ec0911716cace91d3ad85435a5c6123b290b3a2
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
5b03ce95c77e16b46a177af32e640d71b7ff4e12 19-May-2016 Selim Cinek <cinek@google.com> Fixed a bug where autobundling could lead to bugs

Notifications could appear twice if a notification with an app
group became bundled and one could not be swiped away anymore.
This is because we were unconditionally copying over the override
key even if the notification just became a group.

This also fixes a nullpointer that could happen with a racecondition
when a notification was cancelled and it tried to be used for autobundling.

This also fixes an issue that the autobundling wasn't working correctly
when a notification didn't have a group set but was set to be a
group summary.

Change-Id: Icd971f16ae0804ce162fd3171fcdd99bd04f3885
Fixes: 28706404
Fixes: 28628237
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
eae43fbd1712a009c4a59760bf9588b3092e1e37 09-May-2016 Julia Reynolds <juliacr@google.com> Do not bundle cross user.

Bug: 28665081
Change-Id: I026b8a3a731183f96b45c19b95b4a0d109677a4c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
3f19f60d654421eee5b35a92129081f08c977629 03-May-2016 Selim Cinek <cinek@google.com> Fixed an issue where children would animate strangely when removed

Previously we tried to fix a notification flicker when the summary
of a group was removed. This lead to a few issues that group children
would now also generate an animation and the whole notification would
just look weird.
We are now cancelling notification children as soon as their parent
is cancelled already in systemUI to ensure that the animations are
properly rendered.

Change-Id: Ie639b4ad28bdb55d922308e04c14a4e5b32b90bb
Fixes: 28190616
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
076bddde4bfd02613b0bd6efd3a7610898917c5e 25-Apr-2016 Chris Wren <cwren@android.com> cancel group children before summaries

Bug:28190616
Change-Id: I1b716417119cfa3f4ffdd159ab5197cbfa714a8d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
5bba3e7cd39e1acd4c3190f962f258ad3378b4e1 15-Apr-2016 Julia Reynolds <juliacr@google.com> Add content intent to autogroup summary.

Change-Id: I01afb5e9aa7d74844d6640fdc70b39b59ef2093a
Fixes: 28194709
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b1ebc3b7a013a647dd4a3c6f006e00a017886b20 15-Apr-2016 Julia Reynolds <juliacr@google.com> Logging for ranker bundling.

Bug: 28210646
Change-Id: I90d1adaf23d318e07b1a9941ac45b5d6ae0624e8
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
dbf4481cc3eea106992df2ac145269ab737b2f24 14-Apr-2016 Julia Reynolds <juliacr@google.com> Adjustment bundles are defusable.

Bug: 28168811
Change-Id: I1699e6bfd03a5f117cc89585c03e235fe6a99456
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
5961ab3ac5d64473d3224eb6c11563c347df178b 13-Apr-2016 Julia Reynolds <juliacr@google.com> Merge "Remove category from managedservices." into nyc-dev
39a878dbcae7a4f1400d7f61c8dac1188b9d7923 12-Apr-2016 Bryce Lee <brycelee@google.com> Merge "Properly check to see if a suppressor is present before returning it." into nyc-dev
ba3d895283ac04aee2ab3f07f0bfc8d07bfc1b51 12-Apr-2016 Bryce Lee <brycelee@google.com> Properly check to see if a suppressor is present before returning it.

Bug: 28111086
Change-Id: Ib2cde8269443832e5490906396cd95832c7a146f
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a20e8f314f73c4fc43d33783040d2dc7612e7b75 12-Apr-2016 Julia Reynolds <juliacr@google.com> Merge "Return everything but an autogroup summary." into nyc-dev
a3dc1fb0b7f236012fc82360c18c063bb4fc8f69 12-Apr-2016 Julia Reynolds <juliacr@google.com> Remove category from managedservices.

Bug: 27976092
Change-Id: Ic6303b95fc6d612e83f3a42a933ae94bd7c17255
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
4c4ad595dddef18094d69418ab9da6994e580fae 12-Apr-2016 Julia Reynolds <juliacr@google.com> Return everything but an autogroup summary.

Bug: 28132467
Change-Id: I9a6df6d3e876af00a9ef6fc8ed702ed8342c751a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
8ab776cd90f6c6e8c7e63cc4960ad44cc4f2bad1 11-Apr-2016 Chris Wren <cwren@android.com> remove special case code for groups.

Once all the platforms as special, none of them will be.

Bug: 26919636
Change-Id: I70eb05126184feb2af310e71f0ffd82ab9dcebc6
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
012bc7bb9fa1d0731be7b094a3d0631e01b03fbe 12-Apr-2016 Jeff Sharkey <jsharkey@android.com> Fix notifications that are sent for USER_ALL.

Also avoid creating a heavy LoadedApk object which will be cached
around in the long-lived system process.

Bug: 28116427
Change-Id: I1a5fc43e6d559a09088636b2fe4b5c76f08d3413
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b401fa75f90d576bcf665b42e1571b76ecbea649 11-Apr-2016 Julia Reynolds <juliacr@google.com> Don't get application info for the system

Bug: 28107178
Change-Id: Ic1a75a7d6d6e80e0df8f3017fb8737cf18f4dd3a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
196a05724d73832571c6e4ad5372b05840ec041f 08-Apr-2016 Bryce Lee <brycelee@google.com> Merge "Add granular control over disabled effects." into nyc-dev
e46bb37acf6d3cfb9974672ace93f5381f70ad99 17-Mar-2016 Julia Reynolds <juliacr@google.com> Allow the ranker to autobundle notifications.

Bug: 26709317
Change-Id: I5017a471604e513a7b582cdc2f3472441e108fae
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
7219adadb05d916874e7edff553dfc34bccf94ef 08-Apr-2016 Bryce Lee <brycelee@google.com> Add granular control over disabled effects.

Currently, we can only wholesale disable effects outside of zen mode.
There are some devices that require long running suppression of features.
Effects disabling was added previously to support this. However, calling
suppression was broken recently on a device where we needed notification
suppression, but not calling suppression.

This CL remedies this problem by adding more granular disabled effects
hints. The NotificationManagerService has been updated to handle these
request types and present ZenModeHelper with a unified map of what should
be suppressed.

Bug: 27992763
Change-Id: I38b4706446dfd6e1c3eb97266dbc3332b250adda
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ac17049fbd04400fb56ea364ac39ea2ae3a6e2be 06-Apr-2016 Chris Wren <cwren@android.com> Merge "don't pin ranking updates at the end of the queue." into nyc-dev
52020492f26990a1f18aa4474bbfce44b5d0c650 06-Apr-2016 Chris Wren <cwren@android.com> don't pin ranking updates at the end of the queue.

Apparently we schedule ranking updates all the time, so the job gets pulled
to the end of the queue, and can get starved. This change makes sure we
don't schedule multiple updates by leaving it in the queue. If a job in the
queue behind hte update request needs to send an update it will jsut
request one anyway, so we shouldn't miss updates.

Bug: 28015158
Change-Id: Id5b9d05ea6eb35e610ee34651e4cde8cddd4ae66
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e95057ade126e9e159fe05b69c32f85f7891490f 01-Apr-2016 Rubin Xu <rubinxu@google.com> Split ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED into two.

Add more comment to EXTRA_QUIET_MODE

Bug: 27532254
Change-Id: I68a217561afca8b87f523c62393cdad097d5b75d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
93bb8b800661653cc1c65b294eab621554af139a 29-Mar-2016 Chris Wren <cwren@android.com> actually cancel sounds when we get a quiet update

Also add some tests to the notification manager service
to make the refactor more palatable.

Bug: 27742532
Change-Id: I745915299aa2b92ab077e0c801d47864cb562325
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
aa604694450539b4c99901b0714efaa79db3c87d 31-Mar-2016 Andrei Stingaceanu <stg@google.com> Merge "AfW - suspend apps - API polish" into nyc-dev
0867b3af692e75180b9f19e63cfc9a8b42e6cb40 30-Mar-2016 Julia Reynolds <juliacr@google.com> Check permission of package, not caller.

Bug: 27923662
Change-Id: I86fd9ed2e8971bde216f53b6d1a5933e8188a425
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
efc4a344a173ae20ec72b8c05c45b794687fda87 22-Mar-2016 Andrei Stingaceanu <stg@google.com> AfW - suspend apps - API polish

* renamed getPackageSuspended => isPackageSuspended
* does not return false for an error, instead throws
NameNotFoundException if the package could not be
found, or if there is an unknown RemoteException,
wraps it in a RuntimeException and rethrows.

Bug: 27532430
Bug: 22776761
Change-Id: Iee00600089b1c0556a3312b10456826464fa8f9f
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a014e20bf06c94a49a4d1eecbbdb6836e0480616 22-Mar-2016 Julia Reynolds <juliacr@google.com> Fix Sysui crash on volume change.

Bug: 27765028
Change-Id: I812dcf19d497cacde9698fc61d1e1f8686460593
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
620a28bad2b1ddabddf2d78b5a20a762ebc29205 18-Mar-2016 Jeff Sharkey <jsharkey@google.com> Merge "Mark more Bundles as being defusable." into nyc-dev
a2d0102b46abaaa1659ce701a8cf14fd63dc8a0a 18-Mar-2016 Julia Reynolds <juliacr@google.com> Apps that can change DND state can also pass audiomanager DND policy checks.

Bug: 27735850
Bug: 27708335
Change-Id: Ia9cc3e6ba93836ddb00d7e709c32da3d6a244f5e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a04c7a7c6442b8c6f87f5dd11fc5659cdb92decc 18-Mar-2016 Jeff Sharkey <jsharkey@android.com> Mark more Bundles as being defusable.

They're destined for the system, so they're okay to look inside.

Bug: 27726127
Change-Id: Ic85c308a8efe6f9b8652952717c72b3c663d328a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e08dc6cb7bce5910ba3a5f4575088b6a8ef0e2bf 18-Mar-2016 Julia Reynolds <juliacr@google.com> The volume controller has notification policy access.

Bug: 27735850
Change-Id: I7056799923370622362b491058e018db97692281
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
88d2f6dd3b6c35b542ca462e6e0a8486813b35da 17-Mar-2016 Chris Wren <cwren@android.com> don't assume there is an ExtServices package

Bug: 27698377
Change-Id: I0122cc33102d501851f90584019c4ee5c106eb7b
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
8b1918e5a65bdd7617f45e350fe92a58004ea628 17-Mar-2016 Chris Wren <cwren@android.com> Merge "don't call other services in dump" into nyc-dev
d136e51a99df5275eaafdde407e89e78c02b829b 10-Mar-2016 Jeff Sharkey <jsharkey@android.com> Defuse Bundles parsed by the system process.

It's easy for apps to throw custom Parcelables into Bundles, but
if the system tries peeking inside one of these Bundles, it triggers
a BadParcelableException. If that Bundle was passed away from the
Binder thread that delivered it into the system, we end up with a
nasty runtime restart.

This change mitigates this trouble by "defusing" any Bundles parsed by
the system server. That is, if it encounters BadParcelableException
while unpacking a Bundle, it logs and delivers an empty Bundle as
the result.

Simultaneously, to help catch the system process sticking its
fingers into Bundles that are destined for other processes, a Bundle
now tracks if it's "defusable." For example, any Intents delivered
through ActivityThread are marked as being defusable, since they've
arrived at their final destination. Any other Bundles are considered
to be "in transit" and we log if the system tries unparceling them.

Merges several Parcel boolean fields into a flags int. Add better
docs to several classes.

Bug: 27581063
Change-Id: I28cf3e7439503b5dc9a429bafae5eb48f21f0d93
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
acf424a37a87afe78ef6d4c92e2bf1d56fe4b686 15-Mar-2016 Chris Wren <cwren@android.com> don't call other services in dump

Currently the ranker config file is synced to app opps.
Also sync App Opps to the config file.
Then use that data to inform the dump, instead of polling.

Bug: 25424580
Change-Id: I6089532aa8618a31bfc3a36bee630c04c3ef3798
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
af56824e35341f46418c39e47b6855223a446c63 16-Mar-2016 Julia Reynolds <juliacr@google.com> Merge "Prevent apps without DND access from toggling DND via AudioService." into nyc-dev
8f0844262fd9108b49658f329d0b36e0baec0d4f 16-Mar-2016 Julia Reynolds <juliacr@google.com> Merge "Rebind managed services more" into nyc-dev
48034f89b75ecfa4871855afd7b4f701ff927d28 09-Mar-2016 Julia Reynolds <juliacr@google.com> Prevent apps without DND access from toggling DND via AudioService.

Bug: 25395278
Change-Id: Id72830607b01a43848d1261292e5835315ef70d0
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1c9bd42aa31aa22c4c9708c58ad7f01cfd17297e 15-Mar-2016 Julia Reynolds <juliacr@google.com> Rebind managed services more

- Rebind all on user switched
- Rebind Ranker on package replacement

Bug: 27551241
Change-Id: I6b0fe25dd68e2f1f118fde2b8e638193e1ad1868
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
97e56663a7e4574c573489c038f8c76c99b826af 04-Mar-2016 Wei Liu <luciferleo@google.com> Add null-checks to mStatusBar.

So that we can disable StatusBarManagerService on Wear.

b/26877020

Change-Id: I9e2a84f004ddf5a4aec50a84cad76d2a10c701b8
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b7c810957f1d8f73100aff645188eca13eb30171 10-Mar-2016 Chris Wren <cwren@android.com> revert recent changes around system listener registrations

also guard against the ranker calling the self-service registration functions.
"why do we even have that lever?"

Bug: 27577115
Change-Id: I8a01cfdd801320e53d56bcbf515b9ba17e677166
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a82662e3f5d6a36df9d5c0d33d5847d08273bd93 09-Mar-2016 Chris Wren <cwren@android.com> Merge "add a ranking service to the rocket" into nyc-dev
0efdb88ccc9d650e7a644b9be8f63792f2c66841 01-Mar-2016 Chris Wren <cwren@android.com> add a ranking service to the rocket

Bug: 22960980
Change-Id: Ic0e911a2f048a4b47171b338c3de13125852be43
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
be3696d42552ad55ae0a41e9dd9fe81f5b17d3e7 08-Mar-2016 Chris Wren <cwren@android.com> Merge "rename the asisstant service for the ranker" into nyc-dev
e24b9a6cfa4d565d7f49c9ae8f3aeca737d93312 17-Feb-2016 Ruben Brunk <rubenbrunk@google.com> Add a VR listener service.

Bug: 22855417
Bug: 26724891
Bug: 27364145

- Add an API for VrListenerService, which is bound/unbound
from the framework when the system VR mode changes.
- Allow only a single bound VrListenerService at a time.
- Monitor allowed VrListenerService implementations from
VrManagerService and evict services as needed when packages,
users, or settings change.
- Remove previous VR functionality in NotificationListenerService.
- Add component target to Activity#setVrMode to allow
explicit selection of the running VrListenerService from
the current VR activity.

Change-Id: I776335f4441be0e793d3126f2d16faf86a8c621a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e0ba7eb365ac19fdc11c3f820349f0352761b9f4 04-Mar-2016 Chris Wren <cwren@android.com> rename the asisstant service for the ranker

Bug: 22960980
Change-Id: Ibe57933303a488b01c43a7621a488d425d6f707d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cac8862bb93031f75b2ba6eb528e1e954fb4a28d 03-Mar-2016 Julia Reynolds <juliacr@google.com> Inline settings update.

-Show silently is IMPORTANCE_LOW, not DEFAULT.
-Select the correct default option.

Change-Id: Ic09174cf55fcc36a06abf1f8f39bc96beb931f69
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
361e82d399d33e0c45e9a002f2e519f1457a84ad 27-Feb-2016 Julia Reynolds <juliacr@google.com> Api review: AutomaticZenRule

Bug: 27364144
Change-Id: I17fec34d7a277173820bed7829baf5bf905f327a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
0edb50c4bf0a4ae7a40f241c92fa57483ca73552 26-Feb-2016 Julia Reynolds <juliacr@google.com> Api review: NotificationManager

Bug: 27365672
Change-Id: Ic0fd82fb9442d10d6b308182a3859497aa882d07
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
f0f629ffe44716b8d900929135142f0ebb9325f4 25-Feb-2016 Julia Reynolds <juliacr@google.com> Introduce IMPORTANCE_MIN.

Allow HUNs for >= IMPORTANCE_HIGH.
Allow full screen intents for IMPORTANCE_MAX.

Bug: 22960980
Bug: 26918284
Change-Id: Id4d2b90ea2e21563dbc716db411060d826e73699
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1ac52a91dc48f29785b34594ab29453a39bd67f5 24-Feb-2016 Chris Wren <cwren@android.com> remove some logspam and fix an NPE

notificaiton manager is logspamming, and also dump can fail
while collecting a bugreport if an actionIntent is null.

Bug: 27338511
Bug: 27338098
Change-Id: I8648541469887d62ee64b28d96e0cb7e4fab0f7b
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ef37f284364cc45c2ed91bfe04c489d2cedd32d2 12-Feb-2016 Julia Reynolds <juliacr@google.com> Remove Notification Topics.

Bug: 23220370
Change-Id: Ifbcdbab1cf6974c192483091512f75762784a98e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
5ae4e73ef0747c2d08a901f1a76d8fb8ee64a53a 17-Feb-2016 Andrei Stingaceanu <stg@google.com> Merge "Suspend packages - new API for retrieving the suspended status" into nyc-dev
355b232d7998cfc9b29d42a0356390e25191bcbd 12-Feb-2016 Andrei Stingaceanu <stg@google.com> Suspend packages - new API for retrieving the suspended status

Instead of always rebuilding the full ApplicationInfo for a
package when callers are only interested in the suspended status
add a new fast API in Packagemanager (which only checks the
suspended user setting for the requested package and returns
a boolean) and change the appropriate caller code too.

Bug: 26794775
Bug: 22776761
Change-Id: Ide8428ef734479360d5a8a75fd8e0ed8ddf2da7a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
fec58c263c6e3da3fa449fac1d0c2630c8d66bd6 12-Feb-2016 Julia Reynolds <juliacr@google.com> Show topic settings inline if user has configured topics.

Change-Id: Icf51faad61b3ae4261991691a1d679b190ea712a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
146d931ece7fc273311c049067742bab40a9999a 10-Feb-2016 Julia Reynolds <juliacr@google.com> Merge "Allow apps to know what users think of their notifications." into nyc-dev
950b30426e24bb38b7b2ffb461dc0b46e79b35d1 10-Feb-2016 Jeff Sharkey <jsharkey@google.com> Merge "More encryption-aware triaging." into nyc-dev
c7bacab20fa8a0e603726f4f8ebafd3a96babeb1 09-Feb-2016 Jeff Sharkey <jsharkey@android.com> More encryption-aware triaging.

Most of these callers are okay having results omitted when a package
is uninstalled or encryption unaware. For example, jobs and
notifications can only be enqueued by already running apps.

When clearing zen rules, keep around rules inserted by apps on
ejected external storage devices.

Make ServiceWatcher stricter by requiring that the matching package
be in the system image.

Bug: 26471205, 27105254
Change-Id: Ie41ea8042ac1a54e9cbe0c35cec89e70521e9bed
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
81afbcdbf96c687b61ed53170e1654f4f8ea5b15 09-Feb-2016 Julia Reynolds <juliacr@google.com> Allow apps to know what users think of their notifications.

- App wide blocking
- Topic importance

Change-Id: I9026e5c26c5dbcab1c86c385beede891f961933f
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
4a4b49dcbc39e54129546ca2567cbd8f74faef23 09-Feb-2016 Chris Wren <cwren@android.com> don't allow assistant to block notifications.

Bug: 26640716
Change-Id: I5c7b691ff664e8dafd39bf15cb1556731df2b0b9
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d560729ce3a6f3d51c03d39768815b4c49f7a8f4 05-Feb-2016 Julia Reynolds <juliacr@google.com> Update DND visual interruption choices.

Change-Id: I7050264839c566dcef1dd01d155dda694a8d1ec0
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a3dcafff6d92418ad192ea10f906bdf0947f0ce9 03-Feb-2016 Julia Reynolds <juliacr@google.com> NoMan support for FBE.

Rebind to service components that should now available.

Bug: 26941542
Bug: 26940790
Change-Id: Id5290a75894f61cf55b3a2b82d08b1533bf099ca
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
dd3e86bcb0b6a5dc356d903df88c3d5a15510f7c 02-Feb-2016 Julia Reynolds <juliacr@google.com> Allowing querying for apps with blocked topics.

Bug: 26882239
Change-Id: If888cb18891a412067bcb28e575f502c6091f77a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
69766695c6012f1ac77814f788f57661e1d09961 01-Feb-2016 Julia Reynolds <juliacr@google.com> Send ranking update on importance change.

Bug: 26882239
Change-Id: Iae5703a5b024a75b8adc8c5c9c107bfa57013f5b
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
7eadc1bf686de4df0801252263c887ed2c326090 01-Feb-2016 Rubin Xu <rubinxu@google.com> Canel all work notification when the profile is turned off

When the work profile is turned off, all work apps are killed and the
profile marked as stopped. Cancel all pending work notifications
immediately in this case, with a new reason.

Bug: 22541941
Change-Id: I97935c3bac3eba1e9c38f7449ebcc182f6c66769
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
0122f651d1a1de8ccfe6e2789e150507977189c7 22-Jan-2016 Andrei Stingaceanu <stg@google.com> Suspend apps - disable notifications

Disable notifications and posts for suspended apps by
verifying if the package is suspended in NotificationManagerService
where AppOpsManager.OP_POST_NOTIFICATION is checked.

Note that the notificationEnabled user preference is
preserved when unsuspending.

In a following CL will make the "Block all" notifications
setting while an app is suspended (in Settings -> App Info)
readonly so that the user can not turn notifications on.

Bug: 22776761
Change-Id: Ie8edba508bd23406445f9a014404b6d3b17cb223
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
92d456e9a62d7dadb3e21f481f7453bd82b1aa23 25-Jan-2016 Julia Reynolds <juliacr@google.com> Show app level settings when an app doesn't use topics.

Change-Id: I205062868ac3a44aa24a29bcb82a9374026287a7
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
47633425339245a7b126c3e3310994e1a87d5399 22-Jan-2016 Chris Wren <cwren@android.com> implement onNotificationEnqueued callback

Bug: 22455414
Change-Id: I9dafc7b8cbf0268b28d9e9fb0cae9c3b451be52c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
43b70cdc395d3a6cf3bd0a78b686a7f5d3ed86e0 14-Jan-2016 Julia Reynolds <juliacr@google.com> Allow condition providers to specify a rule instance limit.

Bug: 25563007
Change-Id: I1149cb5be59668f8869c81cb46c5ead49aec933a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
85aa6cb1779635bb3b6b3ba739fc4ee3813bba3a 08-Jan-2016 Julia Reynolds <juliacr@google.com> Notification banning updates.

- Dismiss notifications from banned topics
- Don't ban all topics when banning an app.
- Block notifications from banned topics.

Bug: 26154396
Change-Id: I1d94e6176a413386d89f8dc1c4899aee8a8a73b8
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
2d20a4dcc60a4d87ddf536d40cf00a59fa2d9479 08-Jan-2016 Chris Wren <cwren@android.com> Merge "allow listeners to disable themselves"
5942cc59abbdd68fdb46139247a20b961f0c633d 08-Jan-2016 Julia Reynolds <juliacr@google.com> Merge "Sort notifications by importance."
0421e6d58635f347f785ae4c78e8b2a5da327138 08-Jan-2016 Julia Reynolds <juliacr@google.com> Sort notifications by importance.

- Importance trumps 'package priority'
- Only notifications with a high enough importance can be intrusive
- default and lower importance notifications don't appear on the lock
screen and appear below the speed bump in the shade

Also, stop downgrading MAX importance noisy notifications.

Bug: 26425560
Change-Id: Ibb952eb6f8d0d336a1060332f58c8ba622f29867
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ab41eecf22352f54167ce9a272a397715ffd0015 05-Jan-2016 Chris Wren <cwren@android.com> allow listeners to disable themselves

This decouples the user permisson grant from the
bound state of the listener. This allows listeners
that are only relevant sometimes to avoid being
bound as a foreground service all the time.

Bug: 19232554
Change-Id: I9ab078630af5a10c6878d3f19ba80661299713d5
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e06b4d1d9f718b9fe02980fea794a36831a16db2 06-Jan-2016 Jeff Sharkey <jsharkey@android.com> Consistent naming for PackageManager methods.

When hidden PackageManager methods take a userId argument, they
should be named explicitly with the "AsUser" suffix. This fixes
several lagging examples so that we can pave the way to safely
start passing flags to new methods without scary overloading.

Also fix spacing issues in various logging statements.

Change-Id: I1e42f7f66427410275df713bea04f6e0445fba28
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
617215874db9c208a74dc97f4133e6b6fc96271c 05-Jan-2016 Julia Reynolds <juliacr@google.com> DND visual interruptions: prevent screen on.

Bug: 25423508
Change-Id: Ie935a2051e1ae774fbeaf624f3599b2b1bb8666d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
51017d0e23ce9855fabcf786a2067ceb19121fbc 15-Dec-2015 Chris Wren <cwren@android.com> implement assistant service connection

Added a guest-mode to ManagedServices.
Like system services, the lifecycle of a guest is not managed.
Unlike system services, guests are not considered privledged.

The Assistant gets all the usual listener events.
Implemented adjustImportance.
Future work: enqueued, clicked, visibility, removed, annotations

Bug: 22455414
Change-Id: Ic41c0bf625b5e98cb577b49098bba23a539bb507
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
19a02b0f08b0bdad71e172a32ccf614fbe914589 22-Dec-2015 Chris Wren <cwren@android.com> that works, but can you find a more efficient solution?

Change-Id: I19f8ff61973d8db5614f9a699b28df7038e44711
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e00da66cdcad654b1d0d7c129e0a2c2821d95c23 18-Dec-2015 Julia Reynolds <juliacr@google.com> Merge "Differentiate between apps that use topics and those that don't."
be8fdee532cff806a7482863b7c72e907547d127 18-Dec-2015 Julia Reynolds <juliacr@google.com> Differentiate between apps that use topics and those that don't.

Bug: 22451710
Change-Id: Idb567a4fc511a03cb999179765cfa4cbeb63dcb7
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
55bed957788e853d3ee3f674dd6eea79ad3a193b 18-Dec-2015 Ruben Brunk <rubenbrunk@google.com> Merge "Add a framework service tracking VR mode state."
a07af88b9566e34ecb0cfd07f225d7ceb181e8bb 17-Dec-2015 Julia Reynolds <juliacr@google.com> Allow users to set app-wide Importance default

And the associated ui changes to the notification guts.

Bug: 22451710
Change-Id: I4e0b11e7b24d70b039a432c5e6cd76c9c7cc547c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
dd18a0b69537954d1cc34929a1386deb54f12b14 05-Dec-2015 Ruben Brunk <rubenbrunk@google.com> Add a framework service tracking VR mode state.

- Implement a "VR mode" that may be enabled by a focused Activity.
- Add a system service that tracks the current VR mode state and notifies
other core framework services of mode changes.
- Extend NotificationListenerService to allow the bind/unbind lifecycle
of specified listeners to be triggered by system events.

Bug: 22855417
Bug: 25479708

Change-Id: I1ac8692bbb5521bb6c7cfb9d2b56b98b720f8568
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
6350674b013c82431e44800562e74999e11a5fca 16-Dec-2015 Jason Monk <jmonk@google.com> Fix bootloops from new zen changed broadcast

Bug: 26226057
Change-Id: Ie1e0cbfdbb44c6eea3dafed777fe8ad49ca696a5
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
51aeb69dd3ad896dcadab937578e32cafd84c265 14-Dec-2015 Andreas Gampe <agampe@google.com> Merge "Frameworks/base: Fix Notification code"
a9927325eda025504d59bb6594fee8e240d95b01 13-Dec-2015 Jason Monk <jmonk@google.com> Support dnd condition in Settings

- Add way to open QS detail panels directly
- Add internal broadcast that can launch apps when dnd mode changes

Change-Id: If2b6350dc31623f3bf2f64c7eb141cff5d3d4e89
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1ed71f3722830271602d2d3b2bbd1ba692f75835 12-Dec-2015 Andreas Gampe <agampe@google.com> Frameworks/base: Fix Notification code

Avoid a NullPointerException in NotificationListenerService when
a corrupt notification is found.

Fix not using the return of trim() in NotificationManagerService.

Bug: 19797138
Change-Id: I84dc15eba7b4052a774eb69d36591d100105f169
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
41c264bae10dda0a1430251aa982dcf79c728bdc 11-Dec-2015 Julia Reynolds <juliacr@google.com> Merge "Add importance to notification guts."
72be84fd8c2e3b6760e95a118d50e203c16ec379 11-Dec-2015 Julia Reynolds <juliacr@google.com> Merge "use importance instead of score"
bdf3376616c276ed18a51185351b44fd16eeae29 04-Dec-2015 Chris Wren <cwren@android.com> use importance instead of score

Change-Id: Id3b0a074671943b4fcabb63fe990cbfd1e46bdfd
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ead00aac154f76abfc9739d76b100597b3e42d96 07-Dec-2015 Julia Reynolds <juliacr@google.com> Add importance to notification guts.

Note: the guts are still trucated to the height of the notification.
The slider initially shows the importance of the individual notification,
but changing the slider changes the importance for the whole group
of notifications.

Bug: 22451710

Change-Id: Id6de3aaace2bdb88a8cc5db517002dc7f0e349ae
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
4041249f2f233e06a89a603224239c1d6ab2968a 09-Dec-2015 Selim Cinek <cinek@google.com> And suddenly notification children appeared

Bug: 22760612
Change-Id: I0b708368c9c8e06af36184e736d181b2818d29b8
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
5d25ee7a006fda7150ba251cff92c27130611f88 20-Nov-2015 Julia Reynolds <juliacr@google.com> Topics can now have an Importance.

Bug: 22451710
Change-Id: I627121da6c4b85492715a8e8a099656dca52b734
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cf7021e827dde0047bd36d32b734893e98d988fe 03-Dec-2015 Chris Wren <cwren@android.com> Merge "Notification Assistant API"
9fa689f8b614d32f36b5f2de2e3065f4ad6b2358 20-Nov-2015 Chris Wren <cwren@android.com> Notification Assistant API

This API allows a single assistant on the device to help the
user manage their notification stream by taking actions on
individual notifications:

- modifying their priority up or down when they are posted
- possibly changing if and how the notification interrupts the user
- adding annotations under notifications

Bug: 22455414
Change-Id: Idf47972bb71c83f1dc1c9ec68a6fa92ac4fc522f
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
c8e54e8d5ec038ee6f520ee95948e2ef20490e97 30-Nov-2015 Julia Reynolds <juliacr@google.com> Cleanup zen rule instances.

1. When a user revokes zen access
2. When a user clears data

Bug: 25472361
Change-Id: Ia439a7c2bd6dc07a60a374caf4157508131e3578
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
98fe08fec171e0b51e2ed5719b32faf71dddba87 30-Nov-2015 Erik Wolsheimer <ewol@google.com> fix data race condition BUG: 25819358 am: 2242b4d2bd am: 1dbb0355dc am: 1d92c4538f
am: 48543000e0

* commit '48543000e0417213b227b1047a83eb7d8528ff35':
fix data race condition BUG: 25819358
2242b4d2bda7f83cf7813103ff95d9b4e244126f 24-Nov-2015 Erik Wolsheimer <ewol@google.com> fix data race condition
BUG: 25819358

Change-Id: I9d9978c92d084e93ccb41ea1d0fe33ffe3e17e3d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
233a5f97ea7b46814747a99f584b08d4e8c70105 19-Oct-2015 Julia Reynolds <juliacr@google.com> Implement notification ranking by topic.

Including sensitive notification visibility & DND bypass.

Bug: 22451710
Change-Id: I5f3a0c6d59de0495cb904bad6f886eb29ed4bda4
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
bc253a28582c4cdd56cc8a0d49cd69b4624cfb4b 18-Nov-2015 Julia Reynolds <juliacr@google.com> Remove 'peekable' preference.

To be replaced by 'importance' in the future.

Bug: 22854014
Change-Id: Idc9ca79b145d5c69e769c9239ed9291dce40d8c8
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
f612869ae1190e0885b58a3c33b23d36d7732f06 05-Nov-2015 Julia Reynolds <juliacr@google.com> Allow DND mode to suppress visual interruptions.

Bug: 25423508
Change-Id: Idd8242e4bc00a749dbe0b5503c458375fc017072
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
aaf191c7756cafbadb80c712cdbe0a5d526a66bf 26-Oct-2015 Julia Reynolds <juliacr@google.com> Synchronize updates to zen config.

Also, remove some dead code.

Change-Id: If6f4432638aebcedf59a4804a3b5d14b73f12549
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d9228f1135e51d9380bad990d7178490ec474dbd 20-Oct-2015 Julia Reynolds <juliacr@google.com> Stop populating RemoteViews in Notifications.

Builder now stores its parameters directly in the
Notification object itself, reducing the amount of copying
needed to construct the final Notification as well as
converging the two data structures. All Builder data is now
captured in Notification, so it is easy to reconstruct
a Builder for any Notification object.

This obviates all stripping/unstripping operations because
all Notification objects start life "stripped" of their
RemoteViews, which must be constructed explicitly by clients
(presumably listeners wishing to show the notification to
the user in its conventional form).

Note: While contentView, bigContentView, and
headsUpContentView are being @Deprecated in this CL,
specifying custom RemoteViews is definitely still supported!
You just have to use Builder methods to do so.

Bug: 20153922
Change-Id: I81f8ffed0eb76084b2f2b25b97e325858f0a1d05
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
4fe98d6d4cc4898809b81d001f6b8a1b71b08f3a 06-Oct-2015 Julia Reynolds <juliacr@google.com> Remove rename automatic zen rule.

Use zen rule id as key when finding matching rule to update.

Bug: 22977552
Change-Id: I7beeb5688aabe409a9a72aaa3aa27932d590c489
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a47a27ffd92f172298c2728040e49d502a2d6c87 24-Aug-2015 Julia Reynolds <juliacr@google.com> Third party DND provider APIs.

Bug: 22977552
Change-Id: I8c1bac317e9aa5d9565afe3f0c4e2be8fc34e6a9
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
41da2f777f3195a857d25834274a9e4850102b6c 28-Sep-2015 Julia Reynolds <juliacr@google.com> Merge "Allow signature apps to modify notification policies."
6ee2617832548bdbff7cc27a6b8b852516625eb1 28-Sep-2015 Julia Reynolds <juliacr@google.com> Allow signature apps to modify notification policies.

Bug: 22977552
Change-Id: Ib2bc3a55a904011218bb3adb19998cc4a0b7e709
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
7581121ba5736b1626109445c90cc1b65bf90da9 28-Sep-2015 Julia Reynolds <juliacr@google.com> Merge "Revert "Allow signature apps to modify notification policies.""
3a0ee8f9639bd3995bc50e7ecc666f3ca0350985 28-Sep-2015 Julia Reynolds <juliacr@google.com> Revert "Allow signature apps to modify notification policies."

This reverts commit 39a8c353a8f723e5e67bc846f8fa96d580c4abbb.

Change-Id: I9a9a5fcc76202f5d2b3b175e5d5b9361604285d8
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b487ffeef7e9e6cc2fae08c2ef7ac078cf626bd3 28-Sep-2015 Julia Reynolds <juliacr@google.com> Merge "Allow signature apps to modify notification policies."
39a8c353a8f723e5e67bc846f8fa96d580c4abbb 28-Sep-2015 Julia Reynolds <juliacr@google.com> Allow signature apps to modify notification policies.

Bug: 22977552
Change-Id: I7bfd2fe7bcb2e14b9eb7281acbb8a35dbc2ec93e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
02cb6e773b323a0d54b21f43460a23f668b7727c 19-Sep-2015 Fyodor Kupolov <fkupolov@google.com> Added --restricted option for create-user command

Also moved restricted profile create/setup logic from Settings to
UMS.createRestrictedProfile.

Bug: 24212155
Bug: 24303609
Change-Id: I0346a3368de53f4bb4b6e054349f19adac959d7f
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
9249a9097707bb57ae0a7d114eff54bc82ad462d 26-Sep-2015 Bart Sears <bsears@google.com> Revert "Added --restricted option for create-user command"

This reverts commit 737b216b5c28f7d7162f219136d4e8a9eb1a486b.

Change-Id: I4c43967933bb2e46cdb8ad6e643d7037d722cab2
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
737b216b5c28f7d7162f219136d4e8a9eb1a486b 19-Sep-2015 Fyodor Kupolov <fkupolov@google.com> Added --restricted option for create-user command

Also moved restricted profile create/setup logic from Settings to
UMS.createRestrictedProfile.

Bug: 24212155
Bug: 24303609
Change-Id: I5f0d48bcbd3c0b51927926b874fd057c15ac5219
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ddbe4ca1ca3c585cf86dac3823947ebacb7c9be6 14-Aug-2015 Xiaohui Chen <xiaohuic@google.com> Clean up USER_OWNER in notifications

Bug: 19913735
Change-Id: Ib6c2ed11eee6adf062a6dff00c99e62945153f9e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ea6c4489598fce95ac0e22ff13290a9fb264db5a 13-Aug-2015 Julia Reynolds <juliacr@google.com> Clear calling identity before getting the current user.

This is necessary so non-privilged apps can call setInterruptionFilter.

Bug: 23156657
Change-Id: Ia903a39626c93957276d66805446cd25a91341b5
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e6b53e6115a7f3066af8f9d1ff8f45b83b962b83 31-Jul-2015 Julia Reynolds <juliacr@google.com> Include dnd status in bugreports.

Bug: 22868844
Change-Id: I7b64cd8e27d6ebf254150b68ac791f299a72d4b1
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a17703138b0c51226c0e73dd8d34ea037d260aeb 10-Jul-2015 Dan Sandler <dsandler@android.com> Allow notification strings to be unredacted in dump output.

This won't happen automatically and unredacted strings will
still not appear in bugreports, but if you are attached via
adb you can now do `dumpsys notification --unredact` to get
the contents of String/CharSequence fields and extras
emitted along with the rest of the dump.

The arg handling is also improved so that multiple filters
can be specified at once, e.g. --package (was "p") to
restrict to a single package, and --stats to get JSON
output.

Bug: 20451514
Change-Id: I37fc5ce86c7e28e8f8286917f6764d64bc081108
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e4b38805d62493c16003e501e7d32c534d465415 07-Jul-2015 Chris Wren <cwren@android.com> provide a cleaner notification dump

Respond to --stats by generating a cleaner, easier to parse dump.
Optional argument tells historical stats when to start aggregating.
Don't emit debug information about current notification status.

Bug: 20451514
Change-Id: Ie3d25b674421caa6c9e093f5643cb18d4138a7c8
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b659c4f44a839e6ad7ef6834cc0d35954e04460a 25-Jun-2015 Chris Wren <cwren@android.com> report notification load on panel reveal

Counts may differ from user perception. For example, if notifications arrive
after the shade is open (even if it is only peeking) there will not be another
panel_reveal before the user sees the shade. User perception is more accurately
measured by visibility events.

Peek events will report the notificaiton load as 1.

Bug: 20088581
Change-Id: I10221d4b66a18c223aae21e616615f087c65b1e1
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
66189fc16883f330faca928fe8e9b752b4b1a60e 25-Jun-2015 Chris Wren <cwren@android.com> add banned packages to notification dumpsys

Bug: 20451514
Change-Id: I4ae3adfc8dcd7e7625ca41950e5642c30b8cb25e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d1dbc92d67af4cb72bb2faff9011d36b6833bbfd 19-Jun-2015 Chris Wren <cwren@android.com> add rank to notification visibility log

Only sysui knows the true rank, since it can (and does) reorder things.
The visibility logs are down in the service because it has other bits of data.

Bug: 21395744
Change-Id: Ibf9479dc2306fb27fb5df3bf21e161478d36d587
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
c28695079e3511e02845bad9d730753daefba8a3 22-Jun-2015 Vladimir Marko <vmarko@google.com> Merge "Don't prevent notification updates in DOS protection." into mnc-dev
5eab2b72afe5b20dc66c237b1cceedfc09de2d52 16-Jun-2015 Chris Wren <cwren@android.com> high-frequency notification stats.

Aggregate and then periodically report stats that are high-frequency
because they are driven by app behavior, not user behavior.

Reuse the NotificationUsageStats facility.
Remove redundant stats.
Lessen memory foot print.
Enable in-memeory aggregates with small, bounded memory footprint.

Bug: 20258744
Change-Id: I87e391419c53917fa13c68a56f8cdb40a7c8e548
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
2526f33df0c387faead0350a5cdb09ba144dea99 11-Sep-2013 Vladimir Marko <vmarko@google.com> Don't prevent notification updates in DOS protection.

The NotificationManagerService limits the number of
notifications per package+user to 50. Once that limit is
reached, it will refuse new notifications. However, it was
also erroneously refusing updates to existing notifications.

Bug: 5821364

(cherry picked from commit d9f4c95b7de877e888d833d192b9ecbf7bd47f81)

Change-Id: I9abc455ef3863730f8e42c8eecff4892cdbc7c1c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
c8e8729244d75584ce71a74d29c452fe538a22c5 11-Jun-2015 Adam Lesinski <adamlesinski@google.com> UsageStats: Change INTERACTION to SYSTEM_INTERACTION

SYSTEM_INTERACTION events are signals to the system for a package's
implicit actions (service bound, etc).

These should not affect the API visible stats like lastTimeUsed, etc.
USER_INTERACTION is for user initiated actions (notification interaction, etc).

Bug:21761781
Change-Id: I4585cf35fbb158612a3c737710108bec34e89183
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
20ac61b8c0abd5af4ce32707e01cc1a501cbb7f0 08-Jun-2015 John Spurlock <jspurlock@google.com> Merge "Zen: New user flow for requesting DND access." into mnc-dev
7c74f78a85283912d7239214024ccca702622f21 04-Jun-2015 John Spurlock <jspurlock@google.com> Zen: New user flow for requesting DND access.

- User flow is now similar to requesting access to notification
content, namely prompting the user to visit a settings page
for enabling/disabling apps access.
- New ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED intent
for apps to listen to this state change.
- Removed obsolete request method and associated internal callback
aidl.
- Added new android.permission.ACCESS_NOTIFICATION_POLICY permission
for apps to include as a signal that they want to request this access
(and therefore appear in the list on the settings page).
- Improve javadocs, outline the user flow in NotificationManager#isNotificationPolicyAccessGranted
and link to this method elsewhere.
- NoManService now persists the user-enabled package list across reboots
and does so per-user.
- Rename public settings intent to correspond with the noman api.

Bug: 21621663
Change-Id: I72cbc21cd736e6a157b6be5d1d0ba0b4a8e7ef4e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
7a4f9ca937e5e1fd62cb709e1a352cd535c9ae47 05-Jun-2015 Chris Wren <cwren@android.com> remove obsolete notification visibility log

Bug: 21248682
Change-Id: I8656a924514dd01ebc003f3cc81b1a9316919321
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
82ba59de0ea32cdfa1423823bce7fa20c878cd02 05-Jun-2015 Chris Wren <cwren@android.com> add a log for notification alerts.

Bug: 21242827
Change-Id: I1b8beee5cc12a9cd23e81554f7f2236ddc29e2b6
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
517f3ee41afb7713f1fc6fa37a6f3a6efa97a020 28-May-2015 John Spurlock <jspurlock@google.com> Merge "Backup/restore notification policy." into mnc-dev
35ef0a626c89af03d40df1a4eda73aa6725c0941 28-May-2015 John Spurlock <jspurlock@google.com> Backup/restore notification policy.

- Include zen + ranking config in the backup payload.
- Owner user only for now.
- For the most part, reuse existing policy file structure
as the payload format, but elide items that do not survive
across devices (info for secondary users, uids).
- Also elide the manual zen rule, if set.
- During restore, keep ranking info for uninstalled apps
in purgatory until the apps exist.

Bug: 17755700
Change-Id: Iadf71a43cd0efd44fe9a0a29874d60666b6d2076
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
008232acbdc9b6988f498b619b686efd02e614ae 28-May-2015 John Spurlock <jspurlock@google.com> Merge "Zen: Store notification zen policy per-user." into mnc-dev
21258a3703fe16b7c4754aec743215f3063bcdac 28-May-2015 John Spurlock <jspurlock@google.com> Zen: Store notification zen policy per-user.

- Keep a zen config per user in NoMan.
- Add zen config for all users to xml policy storage mechanism.
- Initialize config to default for new secondary users.
- Re-evaluate global zen on user switch.
- Remove some unused code in NoMan.
- Make ZenModeHelper aware of multiple users, keep all configs,
add to dump.
- Log config diffs in addition to the config itself in ZenLog.

Bug: 15845915
Change-Id: Ic847451e5d111c74916def1ea0948db5a76966c9
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
bcec2b0cebd873f8b80c11c8653326fc638af860 27-May-2015 Chris Wren <cwren@android.com> Merge "add event timers to all notification logs." into mnc-dev
e6ddb8a1348d2ea53bc3033be43c4dae922b653a 27-May-2015 Chris Wren <cwren@android.com> add event timers to all notification logs.

previously, some logs had only some times, and not others.

Bug: 21394955
Change-Id: I0d7af163be23f5a989c35aba6e6f6879672543fc
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1b8b22b1a412539020f78a132cff7c8fa7fae258 20-May-2015 John Spurlock <jspurlock@google.com> Zen: Calendar auto-rule tracks primary calendar for corp profile.

- Track the calendar provider for the managed profile user if found.
- Add userId to the shared data structure to disambig calendar ids.
- Delay rule update a bit to guard against chatty updates.
- Fix logging in calendar rule.

Bug: 21155107
Change-Id: Id2303fcc39b1fa7417b1844b7869d773ef92434c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
6650e5767b3d69268af7238cfa65dde6a9f2e0a3 15-May-2015 Chris Wren <cwren@android.com> log notification longevity and freshness

Split out monolithic visibility notifications into individual logs for
each visibility change with longevity and freshness.

Add exposure time to cancelation logs.

Bug: 20122735
Change-Id: I56c112cdb54fb65b41cfbef4c36ce8706729c5cb
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d63f9321e62064660d426efd5abbd885c4a24652 06-May-2015 Dan Sandler <dsandler@android.com> Icon support comes to Notification.

And you may ask yourself: what is that beautiful icon?
And you may ask yourself: where does that API go to?
And you may ask yourself: is it a resource? is it a Bitmap?
And you may say to yourself: my god, what have I done

(This patch fixes a number of bugs in the initial
implementation, but other than that, it's the same as it
ever was.)

Bug: 18568715
Bug: 21141842
Change-Id: I1d3f9427abd7f0bb57e533fcfac708851ff644b6
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
09e51a739f3e408567f0eefafcc5fedb01bc3401 14-May-2015 Daniel Sandler <dsandler@android.com> Revert "Icon support comes to Notification."

This reverts commit 08a04c15245c970856022d0779aa27d4d63cdee3.
This also reverts commit 5bcbf857d129f4513e562801a4e88077b2655ade.

Change-Id: Ia0b0a5339d523581c877822a3a1feec97ae4b73d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
9e9e2e73c6ec7bece20268196dc89ad0c8bafad4 08-May-2015 Wojciech Staszkiewicz <staszkiewicz@google.com> Pass charset to XmlPullParser.setInput instead of null

Passing null to XmlPullParser.setInput forces it to do additional
work, which can be easily avoided if we know the charset beforehand.

bug: b/20849543

Change-Id: Iaff97be9df2d0f99d7af8f19f65934439c9658e2
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
08a04c15245c970856022d0779aa27d4d63cdee3 06-May-2015 Dan Sandler <dsandler@android.com> Icon support comes to Notification.

And you may ask yourself: what is that beautiful icon?
And you may ask yourself: where does that API go to?
And you may ask yourself: is it a resource? is it a Bitmap?
And you may say to yourself: my god, what have I done

Bug: 18568715
Change-Id: I4377b311c538bd1cf36b3fba22326bae81af40c9
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a7d92b19c048fe2b3115073286103e9194a915d6 13-May-2015 John Spurlock <jspurlock@google.com> Zen: Serialize notify conditions calls, defer subscription.

- Don't subscribe/unsubscribe to new rules until the config has
been set, avoids race conditions.
- Process all condition updates on the same thread.
- Add the schedule provider's next alarm state to dumpsys.

Bug: 21111868
Change-Id: I389f4a4905a56d6c976f01408f48f87230109aba
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e7a835bc9d2af1fcdd1a645df77388048ceb1f66 13-May-2015 John Spurlock <jspurlock@google.com> NoMan: Specify all users for noman broadcasts.

Change-Id: I347bc25b09506dd5fd695e68f23e9654bab8103c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
807749301fcbda892dfc8a5832b19acf7d1cf53b 07-May-2015 John Spurlock <jspurlock@google.com> Zen: Simplify notification policy api, add zenmode api.

- Remove the concept of a notification policy management token
in favor of a simple grant/deny per app. Currently, all requests
are immediately granted.
- Add zen mode getter/setting, limit to apps that have been granted
policy access.
- Add intent for zen mode changes.
- Public name for zen mode = "interruption filter", moved from
NotificationListenerService to NotificationManager.
- Add settings metadata for new DND access Settings screen.
- Add the split sender settings for calls vs messages to the public
Policy api.
- This change is meant to finalize the public api, persisting
granted app status and showing the user-visible dialog will be
done as followups.

Bug: 18298798
Change-Id: I511be98d69939f057c0c7dc1a6dfe63d1c468193
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
f47e51ec605fccf7fed9e50d1adc98fbd4e8b340 17-Apr-2015 Amith Yamasani <yamasani@google.com> More usage tracking

Notification listeners can now report that a notification
has been seen by the user and that package is then marked
as active.

Bug: 20066058
Change-Id: I336040a52c44c21fd0d78b02ec9a19d448c64b40
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
0f70ca0e666a384ec9a40235e961aee6dc757a09 22-Apr-2015 Chris Wren <cwren@android.com> Merge "Add notification lifetime to the cancel message."
640e387ce4e8aa97a8139fda54a5f5468e2ff18b 21-Apr-2015 Chris Wren <cwren@android.com> Add notification lifetime to the cancel message.

Also track the total lifetime in the notificaiton record.

Bug: 20122735
Change-Id: I09668be0161de0e1d8201b069e533a9a2203c83c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
994349c61e8697e626a7cd2b241a16b2b7669305 15-Apr-2015 Dan Sandler <dsandler@android.com> Rediscover your own notifications.

This new API, NotificationManager.getActiveNotifications(),
allows an app to recover the set of notifications it has
posted that are still active (un-cleared, un-canceled,
visible by the user). Along with the Notification object
you'll get the original tag and id you used to post it,
wrapped up in the somewhat awkwardly-named
StatusBarNotification data structure (previously only used
internally by NoMan/SysUI and NotificationListenerServices).

Bug: 17320461
Change-Id: I8cd610956fafed4e31526b663cebdc31231ad930
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
f9767d680d63ac1771a17ccc5775cd337ff967b8 08-Apr-2015 Christopher Tate <ctate@google.com> Infrastructure for notification backup/restore

Introduce a fairly general "store byte[] blobs as backup keys" helper, and
use that to integrate with the Notification Manager. The helper provides all
the machinery of managing prior state, compressing the blob on the wire, etc.

Bug 19848954
Bug 20105530
Bug 17755700

Change-Id: I4aa808172244af6db0ab2f4440cc266a797655d7
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1fc476d51203c0b76ebd0f2062adf3059437b0dc 14-Apr-2015 John Spurlock <jspurlock@google.com> Zen: Add notification policy management api.

- Allow apps to read and modify notification policy (currently
which items are prioritized in "priority only" mode), but only
after they've been granted access by noman.
- Access to read/modify notification policy requires a token provided
by noman. Enabled notification listeners are automatically given
tokens (new getter on NLS), but any other app can also request them.
- Currently, all requests are granted.
- Also add a new change intent when the public policy changes.

Bug: 18541928
Change-Id: I482d1c39852d0d961931515e0f0e059a8faee4ed
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b2278d65714c0dd0a6f94d1913db1ebc8bfc8b06 07-Apr-2015 John Spurlock <jspurlock@google.com> An update on Downtime.

The update is that Downtime is obsolete. Replaced by the
ability to define multiple named schedule calendars.

- Make changes to ZenModeConfig to properly model manual
and automatic rules.
- Refactor the zen mode helper (and supporting classes) to
properly handle / report multiple claims on zen mode.
The "manual" rule (specified by the user in the UI) vs
one or more automatic rules.
- Automatic rules are still backed by condition providers,
but the layering is now cleaner. ConditionProviders is now
completely generic, has no ties to zen mode.
- Specifically, the new layering for zen mode (below noman) is:
ZenModeHelper: Source of truth for zen state
ZenModeFiltering: Subhelper dedicated to filtering rules.
ZenModeConditions: Subhelper dedicated to managing automatic rules.
ConditionProviders: Underlying engine for reporting named boolean state.
- Migration story for users with existing downtime config, migrated
to a single new calendar named downtime.
- For users with no existing downtime, two default calendars are created
for weeknights + weekends (icu4j for all locales will be done in a followup).
- Remove obsolete DowntimeConditionProvider/NextAlarmConditionProvider and tracking.
- Clean up obsolete resources.
- Add common zen summary description string computation.
- Add proper noman wrappers for the new model.
- Change the semantics of the global zen setting. It is now read-only. Setters
must call noman, added a "reason" to all calls for better attribution.
- Update zenmodepanel + volumedialog to the new model.
- Display the one or more automatic rules in the new zen footer summary.
- "Snooze" the automatic rules when the user explicitly turns zen off.

Bug: 20064962
Change-Id: Idd9deb865a6035ad0cfae660198dccb517e6d7cc
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1d881a1e986c706963c254fbe2b6296a1cd10b75 19-Mar-2015 John Spurlock <jspurlock@google.com> HUN: Implement per-package config.

- Keep track of whether or not HUNs are allowed per-package.
- No impact on ranking, purely presentational.
- Simplify RankingHelper with a package table.
- Improve RankingHelper dump.
- Fix some warnings and typos.

Bug: 19776495
Change-Id: I28d69df69b576f4eabbb528eabecb1f736f0e830
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b5605e58cb8080c8c887b1885336b707596c8094 20-Feb-2015 Selim Cinek <cinek@google.com> Enable surfacing of notification children

Yo Dawg, I herd you like notifications, so I put a
notification in your notification so you can be
interrupted while you are being interrupted.

Bug: 15869874
Bug: 15188947
Change-Id: I6c733d6f8e8a04f85036182f82d3e945c6feb5bc
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a70829946265047ef9798829a176978d578a915c 09-Mar-2015 John Spurlock <jspurlock@google.com> ZenLog: Track changes to effect suppressorship.

Bug: 19656287
Change-Id: Ibbb42bef68f4588beac4ca971db73a19678c2b4c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
bddb5bc84605f489a8ed03f63374fd41d8d1cb66 04-Mar-2015 Chris Wren <cwren@android.com> Remove spammy notification_cancel event log.

We also log when notifications are actually canceled,
so this only tells us how often clients cancel non-existent
notifications. The answer: quite often.

Bug: 19599876
Change-Id: I812866cb080d51974d4db0b6e6b3eb50c3aeb560
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
45cc62a33e0f0ea1a0a59b8c46c8bc8bda5872e9 13-Feb-2015 John Spurlock <jspurlock@google.com> Merge "NLS: Add a public signal value for an undefined filter value."
b25334ca3c2c4f792254bf8e628788d0b7c4775a 13-Feb-2015 John Spurlock <jspurlock@google.com> Merge "Allow sysui-managed remote volume controllers."
831041036587efbceb395bface176752a6b560bc 13-Feb-2015 John Spurlock <jspurlock@google.com> NLS: Add a public signal value for an undefined filter value.

We have three possible defined values for getInterruptionFilter().
i.e. All/Priority/None.

However, this value is only returned to listeners once connected,
otherwise we return 0, an undefined value.

This change gives a name to this undefined value to make it clear
that callers should not infer any meaning from it.

INTERRUPTION_FILTER_UNKNOWN = 0;

Bug: 19288429
Change-Id: I8ae94d1723289ca5714800906f9bf4e7e8111813
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cdb57aeb0e2c83a887c86da0ca2a890df7f02f41 12-Feb-2015 John Spurlock <jspurlock@google.com> Allow sysui-managed remote volume controllers.

- Relax restriction on audio service calls that assume the volume
ui is systemui, allow calls from a blessed component app.
- Blessed component app service saved in secure settings.
- SystemUI mediates requests to replace the volume dialog, prompts
the user on activation.
- Show a low pri ongoing notification when the volume dialog is
being replaced, to allow user restoration at any time.
- Replace the controller management code in VolumeUI to use a
ServiceMonitor, backed by the new blessed app component setting.
- Add proper zen-related noman client wrappers, make avail to the
registered volume controller.
- Everything is still @hidden, no api impact.

Bug: 19260237
Change-Id: Ie1383f57659090318a7eda737fdad5b8f88737d4
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
f370177e94782a3c2d141015fc0d0203f08799a0 12-Feb-2015 John Spurlock <jspurlock@google.com> NoMan: Initialize filter value reported to listeners.

In addition to relying on change callbacks.

Bug: 19288429
Change-Id: Id54473e5fbb4eac3778781a2052ba0103076f8d1
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
29cd7f19625a2a2a8528469e55f3aa495107b9e7 08-Jan-2015 Dianne Hackborn <hackbod@google.com> Fix issue #18827122: system server crashed on broadcasting...

...an intent with invalid or null package uri

Also tweak battery stats to record in the history when we shut
down, to understand when restarts are due to clean shutdowns or
crashes.

Change-Id: I6443dafc23e356be9f569906f6081152d4f92d2b
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
4a9849b1d9ceee01bb47cbdfec25a88568bae80f 06-Jan-2015 Christoph Studer <chstuder@google.com> NoMan: Cancel previous instance of ignored notification

When a notification is ignored due to notification group optimization,
make sure any existing instance of the ignored notification is
canceled.

Bug: 18914108
Change-Id: Ifcc4833df019ea5cb7048eaab11ae76e7fa2a31c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
57627794b682235afd60adfb235fee46d32f54e2 11-Dec-2014 John Spurlock <jspurlock@google.com> Audio policy: Fix deprecated shouldVibrate api.

And apply zen mode immediately to avoid race conditions
in tests.

Bug: 18702149
Change-Id: Iad156a29b9e6a5998e7c2dafa8b79a71447066f9
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
8403b7535b7b13e5aed732963fc49cf477b9a92e 10-Dec-2014 John Spurlock <jspurlock@google.com> NoMan: Apply audio restrictions when effects are disabled by listeners.

Bug: 17990185
Change-Id: Id946fab4dd27e2354919de6a98c009bc2e711240
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
530052a2fe3b6a6a4246ce28ab0ced647fe7f470 30-Nov-2014 John Spurlock <jspurlock@google.com> Zen: New behavior for built-in downtime + nextalarm conditions.

- Downtime: Allow user to enter downtime early, offer as an end
condition four hours before downtime starts. Available in
either none or priority, regardless of settings configuration.
- Downtime: Always exit before next alarm if zen=none.
- Downtime: Make more like any other condition provider, remove
special status (mostly).
- Downtime: New auto-triggering rules, allow triggering after a
manual condition ends, once.
- Decouple NextAlarm + Downtime providers, allow them to offer
their conditions at the same time.
- Downtime/NextAlarm: Update conditions if they change while being
requested, even if unsubscribed.
- Make all three built-in condition providers optional, via config.
- New internal helper for runtime config.
- Don't follow changes to next alarm, consider the condition false.
- Isolate downtime calendar logic into separate class (for testing).
- Allow a:bb -> a:bb as a valid downtime range (all day).
- Volume dialog: configuration establishes maximum number of visible
conditions, including built-ins.
- Zen mode panel: avoid widget updates during layout transition.
- Zen mode panel: move controller callers to background thread.
- Zen mode panel: hide/show/rebind rows instead of adding/removing.
- ZenLog: Add downtime autotrigger results.
- Volume panel: Smarter refresh on ringer/zen changes.

Bug: 16373455

Change-Id: I4f801018ddb0beb6eb9fa03a81c79f7949888a3f
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
798c05523bc238853269a24dc526a31f0464a589 04-Dec-2014 Christoph Studer <chstuder@google.com> Merge "NoMan: Update effect suppressor on listener remove" into lmp-mr1-dev
ffc050ad369c09d740d33f72e66d03f6e2473c49 04-Dec-2014 Chris Wren <cwren@android.com> Merge "Track active notifications by key, not by reference." into lmp-mr1-dev
6054e614769f03e29ba08475abf01982ace3d6a1 25-Nov-2014 Chris Wren <cwren@android.com> Track active notifications by key, not by reference.

Updates can change the reference without changing the key,
leaving the manager confused about which notification is active.

Fix applies to tracking active sound, vibrate, and lights.

Bug: 18369462
Change-Id: I0f606e6ef441737364795ba6feede1a7e5681191
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
27ef018846fc88122bcb2c30ba86e99a5b3039d6 02-Dec-2014 Christoph Studer <chstuder@google.com> Merge "NoMan/SysUI: Clear LEDs only when entering the shade" into lmp-mr1-dev
1f32c65697c22f423c2888cf4c53da1c95d602c1 26-Nov-2014 Christoph Studer <chstuder@google.com> NoMan/SysUI: Clear LEDs only when entering the shade

Don't clear notification LEDs when seeing notifications on the
lockscreen.

Also fix a bug where the LED didn't continue flashing after
the screen turned off.

For devices with doze capability, ensure that the LED continuing
to flash after screen off doesn't cause an immediate pulses, but
delay the first pulse by 10s.

Bug: 15449039
Change-Id: Id34d51a2c91ceaf069e49add1ab690bb855f9638
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ff02faf8f3db791956a99ff0bb87eafb52f333d4 02-Dec-2014 Christoph Studer <chstuder@google.com> Merge "NoMan: Optimize grouped notifications" into lmp-mr1-dev
0d6ef4bd2b57fc8abe877ac4c6dd511cb8fa467a 02-Dec-2014 Christoph Studer <chstuder@google.com> NoMan: Update effect suppressor on listener remove

When a listener requested HINT_HOST_DISABLE_EFFECTS,
fire ACTION_EFFECTS_SUPPRESSOR_CHANGED when it's removed.

Bug: 18578756
Change-Id: Ia20793f17fc376130f370e736efad8b15f0cfa6d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
661f2cf45860d2e10924e6b69966a9afe255f28b 17-Nov-2014 John Spurlock <jspurlock@google.com> VolumeZen: Introduce internal vs external ringer mode.

Stabilize mapping between ringer-mode=silent and zen=priority
by keeping track of two ringer modes:
- Internal ringer mode: Used for underlying stream muting
- External ringer mode: Reported to clients

The mapping between external ringer mode + zen is:
- normal = all
- vibrate = all
- silent = priority (read-write) or none (read)

Changes include:
- Remove "zen check" from audio service, back to audio
service having no knowledge of zen.
- Maintain a new external ringer mode in audio service,
this is the ringer mode reported through AudioManager
to callers, also mapped to the change intent.
- Introduce a "ringer mode delegate" to the local
audio manager interface, responsible for observing
external / internal mode changes, and making changes
if necessary.
- Internal ringer mode changes are still interesting
to the volume dialog, wire up a callback through
the existing IVolumeController interface.
- On devices without vibration, the mapping is the same
but since no ringer mode change is possible, disable
the icon toggle and remove the mute icon when volume=0.
- On devices with vibration, volume down presses should
pulse the vibrate icon (and vibrate) as a hint that this
is as low as the device can go using the keys. Since
the mechanics are similar to the existing zen=none hint,
pull into shared helper.
- Log ringer mode changes to the zen log, include calling
package information for issue diagnosis.
- Include whether vibration is supported in the audio service
dump.
- Update the status bar icon policy to use the internal ringer
mode, not the external mode (for vibrate icon).
- Update the "Muted by <x>" logic, include current suppressor
in dumpsys, ensure suppression icon is enabled & !clickable,
regardless of zen mode.

Bug: 17884168
Bug: 15471679
Bug: 16824970
Change-Id: Ia7d3bb23ce6d1e37b24fb6521d1c1ab9bb8f60c0
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
265c10587a0716f46cd17441dea18da303e0725e 23-Jul-2014 Christoph Studer <chstuder@google.com> NoMan: Optimize grouped notifications

When SysUI is the only notification listener, drop group children
if there is a group summary in NoMan.

There are two changes needed to achieve this:
1. Cancel children when a summary is posted
2. Drop children if there is a summary

Bug: 18460939
Change-Id: I5a3f30b0b23b2a784783749f58352c05a7fb9e59
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ce00a234eda550251d42d13540df30713072a514 21-Nov-2014 Chris Wren <cwren@android.com> LED should not be blocked by interruption filtering.

Bug: 17204854
Change-Id: Ife30c2ebbcf3fce87ac262dbd339b694d4a57728
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1c066306c6cac35210e27b5af70fa6584bcad11d 18-Nov-2014 Marco Nelissen <marcone@google.com> Use stream type if set by user

Bug: 18426086
Change-Id: I0df390ddb850f8e2a02e24296f2a0d39f5718839
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
8cfb3f1e4dc76c4fa92e889991f0e9dd37823d1b 29-Oct-2014 Kenny Guy <kennyguy@google.com> Merge "Listen for package changes for all users not just owner." into lmp-mr1-dev
7005840d884b467d817641f077cf1e6aa24ee636 28-Oct-2014 Kenny Guy <kennyguy@google.com> Listen for package changes for all users not just owner.

Listen for package changes for all users to cancel notifications
for secondary users and profiles when an app is uninstalled.

Bug: 18151696
Change-Id: I6921729e2878e1e5890411b173a56849eb2e0745
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1382e67e1c551796ed626a68fa91f2b4cdfbfa1a 24-Oct-2014 Christoph Studer <chstuder@google.com> NoMan: Add update bit to notification_enqueue log

Log whether an enqueued notification updated a previously present
notification.

Bug: 18083122
Change-Id: Ie6ed69f0bf53c668701b44e33282ca74b509a7e3
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
81e5b5f2f85ea0a00c4ee51f648dbe37b25ab9bd 22-Oct-2014 Christoph Studer <chstuder@google.com> NoMan: Log canceled notifications

In addition to logging cancelation command, also log actually
canceled notifications via the new eventlog tag notification_canceled.

Bug: 18083122
Change-Id: I1e3e1e1368f39519f34c002ae374f318f647a401
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
4da84cd56582fb4025eb5a9a1d4bb5b5b4a50cef 21-Oct-2014 Christoph Studer <chstuder@google.com> SysUI/NoMan: Log clicks on notification buttons

Introduce notification_action_click logtag that is logged whenever
the user clicks any notification button. For standard templates, we
also log the index of the pressed action button.

Bug: 18064190
Change-Id: Icb07795ff711729d16bde0b7e03d13c2f466779c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
32fe4c6e642ae8a2b36136e33040e12f88aa5e07 02-Oct-2014 John Spurlock <jspurlock@google.com> Disable notification effects during phone calls.

Listen for phone call state changes in NoMan, and disable
incoming non-call notification effects when non-idle.

Bug:17658454
Change-Id: I6f7d66413970fbff6822ab29a12f91cbed068261
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
12aeda802ed91a49977a22166319ce74a3352e30 23-Sep-2014 Christoph Studer <chstuder@google.com> NoMan: Add 3s timeout in matchesCallFilter()

In Priority mode, NoMan can block the telecom Ringer
indefinitely when looking up the caller contact details via
ContactsProvider.

Fix this by introducing a 3s timeout and assume the call
matches the call filter when the timeout is hit.

Bug: 17598245
Change-Id: Ia0893cf203e6ffd943c749719ebb9e0f0958eb01
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
365e4c38d58d38bb61d1fdd870346f2f594825fd 18-Sep-2014 Christoph Studer <chstuder@google.com> Remove FLAG_FOREGROUND_SERVICE on Service.stopForeground()

When services call Service.stopForeground(), remove
FLAG_FOREGROUND_SERVICE from the notification that was supplied
to Service.startForeground().

This enables services to post notifications that become user
dismissable when they switch to being a background service.

Restrict this to targetSdk=L apps to reduce the risk of breaking
existing apps.

Bug: 17551106
Change-Id: Iff8541e5bb2a23ad1fbc9ad80df5fd6eb683148b
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
820b70da0245bb2bc48d7b91f7207348514ee61d 12-Sep-2014 Christoph Studer <chstuder@google.com> Merge "NoMan: Refresh ManagedServices on user switch" into lmp-dev
135ce76a26b94e6725c48abd87806946b0d4bc81 12-Sep-2014 Chris Wren <cwren@android.com> Merge "remove unused matchesCallFilter(Bundle, int)" into lmp-dev
b53dfd4faeb57a51b6cdfc6bde6a441ef9a7ec31 12-Sep-2014 Christoph Studer <chstuder@google.com> NoMan: Refresh ManagedServices on user switch

Fix a bug where ManagedServices didn't unbind from obsolete and
bind to new services after switching the current user.

Bug: 17477093
Change-Id: Ica28978a01f84ba17bdd93e2feaf68547e837bcc
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
335e1f03df933bb5e4e4d9c00811192b1b19a92e 11-Sep-2014 Griff Hazen <griff@google.com> Fix a NPE in NotificationManagerSerivice.cancelNotificationFromListener

If a provided notification key does not resolve to a Notification Record

Bug: 17473071
Change-Id: Ib4b4156ca91eb9e545274a36722c2dc547aa39a3
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
97dc52c8579d70a075e9c999f1f244bbcf3e9bc1 09-Sep-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge "Prevent NotificationManagerService from using bad stream type" into lmp-dev
2f439763bd4ce8b38ab66ed45e3d8ed4a31e9a33 09-Sep-2014 Griff Hazen <griff@google.com> Merge "Remove reference to StatusBarNotification after the value is accessed." into lmp-dev
ceb79bc31a91daf3d43156947f6666d2a8887859 05-Sep-2014 Jean-Michel Trivi <jmtrivi@google.com> Prevent NotificationManagerService from using bad stream type

When deriving AudioAttributes from a Notification instance,
and having to use the legacy stream type field, make sure
it has a valid value, or use the default notification
attributes.

Bug 17408227

Change-Id: Icd1a122b33b8eceb1f6a177699885b0fb8a99b7c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
6a73202e00c2cef8f9438c3308f19739101c3d6d 08-Sep-2014 Christoph Studer <chstuder@google.com> Merge "NoMan: Fix speedbump with multiple package priorities" into lmp-dev
e9aac5f44d7bf8c4a523773e57c30fd8340850eb 06-Sep-2014 Griff Hazen <griff@google.com> Remove reference to StatusBarNotification after the value is accessed.

StatusBarNotificationHolder values are fetched exactly once.

Bug: 15426276
Bug: 16575857
Change-Id: I3d11aba717d17426d31e7b1a07560f6b7e79c4ec
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
69dd40d08a164d5c357442733cf291719dfe94e8 05-Sep-2014 Griff Hazen <griff@google.com> Merge "Reduce chance of notification listener dropped messages." into lmp-dev
7381daa0b99ef5beb224ffd2544a156af40e78d1 05-Sep-2014 Chris Wren <cwren@android.com> remove unused matchesCallFilter(Bundle, int)

Bug: 17402728
Change-Id: I0be7c70597a629ca0bd60b7230ffcc58e8e7aeac
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
fbac21410383e65951cb88ff567ae6bf2dcde82e 05-Sep-2014 Christoph Studer <chstuder@google.com> NoMan: Fix speedbump with multiple package priorities

Bug: 16782616
Change-Id: I747dc981f7974720da9f277ec6e3fba31c21f226
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
c237555c6cb89c347acf13eba45b875946473501 05-Sep-2014 Chris Wren <cwren@android.com> Merge "Keep contact affinities separate across users." into lmp-dev
da4bd209cffad7e47a4bc6e9f02c4bfc333d3d8d 04-Sep-2014 Chris Wren <cwren@android.com> Keep contact affinities separate across users.

Also ignore people extras on USER_ALL notifications.

Bug: 16213960
Change-Id: Ic0341c88d42d4a4f12cac35c0f41c2746aec02ac
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
327bf78a7d1fd0ebf270af04005e9ff2405b59b7 05-Sep-2014 Christoph Studer <chstuder@google.com> NoMan: Fix speedbump for PRIORITY_MIN intrusives

Bug: 16782616
Change-Id: I35fb875bed8cbd90ecd37edc8973c1771be3584d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
3ad4e3a45bbe44129b14c4d391431e44f1e04f0c 02-Sep-2014 Chris Wren <cwren@android.com> Honor per-app sensitivity setting.

Settings are stored by NotificationManagerService in the policy file,
and are communicated to NotificationListeners via a hidden API on the
RankingMap object.

Bug: 16324353
Change-Id: I2d5cf6782273744cbf9b309dec76780cc0a4c39e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
84a00ea9e3df3ff051d3e86945d2befea32072ee 03-Sep-2014 Griff Hazen <griff@google.com> Reduce chance of notification listener dropped messages.

The existing code for notification manager/listeners uses a oneway
binder api to deliver messages. One problem with this is that
notification objects can sometimes get fairly large, and can bump
into the oneway binder transaction buffer if many happen at once.

To reduce this issue, flip the service into a oneway delivery of
a status bar notification holder, whose wrapped content is then
immediately fetched upon receipt of the one-way message. This moves
the meat of the fetch to be over a two-way interface without changing
the properties of which object is actually sent (a tickle solution
with lookup key would have changed this)

Further research: attempt to chunk notification objects themselves.
They can sometimes transfer hundreds of KB over a binder transaction.

Bug: 15426276
Change-Id: Ib1a1f4ff848c16f80bcf2ae4dfd2b87a9091f0b2
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
bd6937841983230bd65dc08548367caa7d409238 30-Aug-2014 John Spurlock <jspurlock@google.com> Merge "Add a hidden system method to check call filter." into lmp-dev
2b122f4c2e691f0319e4f9ea5873989792bb56a6 27-Aug-2014 John Spurlock <jspurlock@google.com> Add a hidden system method to check call filter.

As a stopgap for dialer, add a NoMan method to check
whether or not contact extras meet the current notification
interruption filter, if phone calls are allowed at all.

Bug:17299986
Change-Id: I4d7e04b974d878504ef4e3a73cb6b602cdd2f73e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b82bc785c966b59621a3a2523ba7cdf84a73697b 20-Aug-2014 Christoph Studer <chstuder@google.com> NoMan: Allow listeners to specify notification trim

Bug: 16574195
Change-Id: I116080df8b73d73040cf9dbc751e25ee118641d7
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
85a384b4256121eb85b7e72bcd50f3348f365d41 27-Aug-2014 Christoph Studer <chstuder@google.com> NoListener: Factor out ZEN mode API

Bug: 17255109
Bug: 17295014
Change-Id: I7e1f6e29b8a23b8e59a8615a8012a86bd5dd22d7
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cd4adf8b5ef9ac1f90fdddbb405404e173aedc87 19-Aug-2014 Christoph Studer <chstuder@google.com> NoMan: Fix inconsistent notification comparator

Switch second phase of notification sorting to lexicographic
string comparison in order to enforce a consistent comparison.

Note that this slightly changes the logic: Within groups we
previously fell back on authoritative rank comparison when
one of the notificiations didn't have a sort key. Now we
just replace missing sort keys with " ".

Bug: 16626175
Change-Id: I91f4f4afeeb2c8edda6cd2668011a7367795086c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
f50d82a1e4eed3507309036205e3880974752390 26-Aug-2014 Christoph Studer <chstuder@google.com> Merge "NoMan: Cancel children when update removes summary" into lmp-dev
ea75fddbb452638f286c2fcdbddff145ee1a85cb 12-Aug-2014 Dan Sandler <dsandler@android.com> Allow listeners to fetch current notifications by key.

Bug: 16574195
Change-Id: I269dbcc7fc8912d84229f6a3d950b0015625ae7a
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b4782526f5600d9759baac64b23e0c0cd05e2050 22-Aug-2014 John Spurlock <jspurlock@google.com> Display notification effects suppressor in the volume panel.

Bug:16958514

Change-Id: I0eac173875e8af62e3c6b39001722c3fda4517de
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
c44caa9b841df604a66834df495710e354c7e018 22-Aug-2014 Christoph Studer <chstuder@google.com> NoMan: Cancel children when update removes summary

When a notification update causes a group summary to be
removed (e.g. because the group summary is updated to be
a non-grouped notification), cancel group children.

Bug: 17143007
Change-Id: Ic295a5fc6ee5fe7efb8e71fe8bd1b2c0159461aa
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
0fc2ff7b8a70a7066b484e1519daa17e2dd2f147 20-Aug-2014 Justin Koh <justinkoh@google.com> Merge "Add check to allow notification listener packages to post >50 notifications" into lmp-dev
38156c504e49e685b67b5f003a11876438157c4f 04-Jun-2014 Justin Koh <justinkoh@google.com> Add check to allow notification listener packages to post >50 notifications

Bug: 13433398
Change-Id: I77abf19982add240e1bbe8196fbe148d32884f68
(cherry picked from commit 2dbd36fc7f9341ecef51c2ed96a0f21b046f5a8d)
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
dd753c00d5c25600f0c297b9d1e89e2c4b064bc2 19-Aug-2014 John Spurlock <jspurlock@google.com> Zen: Remove "allow disable" filter from noman.

No longer used by dialer.

Bug:15344099
Change-Id: Ib2d00804f671fae520303531e8ccde9e44f817ec
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
4db0d98b42a723f2e16c6595e85e866fd26c6d98 13-Aug-2014 John Spurlock <jspurlock@google.com> Zen: Downtime now a condition provider, persist conditions.

- Persist the entire exit condition instead of only the id.
- Make downtime a proper condition provider (similar to the
existing countdown provider for time-based conditions)
- Move all downtime-related items out of ZenModeHelper and
into the new condition provider.
- Reevaluate downtime more often, when any of its inputs change.
- Make sure downtime appears as an available condition in the
condition panel when applicable.

Bug:16296125
Bug:16211189
Bug:17031767
Change-Id: I1d8269a4e6fe170ce776bf932dbbdfb29dd25dd7
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ceb4d418464d1b72c450c5e390b1cc7b1f92a49f 13-Aug-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge "Add support for AudioAttributes in android.media.Ringtone" into lmp-dev
3929232cf9d17f81e4fc31004fef3deaa9096826 13-Aug-2014 John Spurlock <jspurlock@google.com> Send LED signal up to SystemUI regardless of setting.

Let it make an independent decision about whether or not to
do anything with it.

Bug:17001245
Change-Id: Ie494abec423f3620bf142ad332bb5f0a4d4341a5
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
81f871e2b96125d57b76c07169e868e516443794 07-Aug-2014 Jean-Michel Trivi <jmtrivi@google.com> Add support for AudioAttributes in android.media.Ringtone

Deprecate use of stream types.
Map deprecated API to AudioAttributes.
Add new methods to specify AudioAttributes on a Ringtone instance.

Bug 16790748

Change-Id: Ifb3c2e838e1f119614459ad7d71d83a4d7c9ffdb
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
5c8ea2c369deab75719fe7c7301846a8ef955702 08-Aug-2014 John Spurlock <jspurlock@google.com> Merge "New api to sync zen mode state from listeners." into lmp-dev
41da5ff98f68a575fc46085e8714c8a3e5e5c17a 05-Aug-2014 Daniel Sandler <dsandler@android.com> Debugging bad notification sorts.

Bug: 16626175
Change-Id: I6cc7ee5f853c846e3aed6f9750e8fb6bc5aed699
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
8d11a5aa2d42416d580dcf7318200be8b8681dec 05-Aug-2014 Justin Koh <justinkoh@google.com> Allow listeners to see children

Allow listeners to see notification children. Since L is not baked yet, keeping
this version check makes it difficult to test apps.

Bug: 16733244
Change-Id: I70afd6b99fc18c1f0b9188279c04fab80c37d414
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d8afe3c41e65a8f6ff4283c124ba250c92cf50c6 01-Aug-2014 John Spurlock <jspurlock@google.com> New api to sync zen mode state from listeners.

- Allow connected listeners to request changes
to the primary device's interruption level.
- Rename alerts -> effects in the other constant,
which does not affect interruption level.
- Rename "flags" -> "hints"
- Basic NoMan wiring for level hint.

Bug:15888672
Change-Id: I2b07fb2c9d32a143fff7c260b7d2cd4d0cd3a592
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cb566aab57cafb69c628809fc0a0ffa2151c7d6e 04-Aug-2014 John Spurlock <jspurlock@google.com> Doze: Follow the notification light.

- Send the notification light info up to SystemUI from NoMan.
- Doze mode will now periodically pulse the display (once)
if the notification light is active.
- Change "tease" terminology to "pulse", which is the singular.
Maintain the multi-pulse on buzz-beep-blink for now as extra
emphasis.
- Scrim controller now always takes number of pulses as an arg,
to support a single pulse (used for notification light, and
eventually pickup once available).
- Dial down the display brightness when pulsing.

Bug:15863249
Change-Id: Ifb208a27e82b66cff1d0c04e5b7f758098ea29cf
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
3f31f5db65f5c2f6193ab58c9c3ea6603a1f5d92 31-Jul-2014 Christoph Studer <chstuder@google.com> NoMan: Use Notification.isGroupX() methods

Change-Id: I041f449361959440a5be7375e655a31fd14e7862
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cef37cf5c749d140070d6d1bcf1cf41072843962 25-Jul-2014 Christoph Studer <chstuder@google.com> NoMan: Filter group children for pre-L listeners

Bug: 16189575
Change-Id: I5297b5273ab0aaee599981738eb736a49f21ce53
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
4600f9b60753adab4e65258a05744a46938fce86 22-Jul-2014 Christoph Studer <chstuder@google.com> Strip RemoteViews from Notifications, re-create them in SysUI

Bug: 16329721
Change-Id: Ic0bea763ffaec4c5644ca78705007211ac6b4b88
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
78403d79739605511ea88b653564d81d7bf4bbba 28-Jul-2014 Chris Wren <cwren@android.com> Add a log and statistics for notification expansion.

Bug: 16618854
Change-Id: I501f396fa495e1e55a27d7d0b65aac66495418c1
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
bfa5dc4c6c486bdabadb5ea2e356a7d348e3b975 29-Jul-2014 John Spurlock <jspurlock@google.com> Zen: Classify notifications using the alarm stream.

Also:
- include audio attributes in dump
- workaround for recent AudioAttributes change.

Bug:16455021
Change-Id: Ib9b047a74cff3e0cc354a5aaa96bc92a400b3845
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cad5768e22e5132efb2e5179f4988a763c7a8d9e 26-Jul-2014 John Spurlock <jspurlock@google.com> Doze: Update tease signal to buzz-beep-blink from NoMan.

Inform SystemUI when NoMan buzzes, beeps or blinks. Use that
as the notification signal when dozing instead of trying to figure
out interesting panel content updates.

At some point, we should move the entire calculation up into SystemUI
itself, but that's too large of a refactoring to perform now.

Bug:15863249
Change-Id: I40e92334977e0676a1363774c2cbbf91d72ec8e5
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1fa865f396e94913cfbbd32ce7799c2e8aeb7a08 21-Jul-2014 John Spurlock <jspurlock@google.com> New NotificationListenerService listener flags api.

Give activated listeners the ability to request changes to
listener-level or host-level state.

Currently this consists of the ability to suppress notification alerts
(alerts = the haptic / audio feedback of a notification).

Bug:15888672
Change-Id: I045e3b99d1f15e3f96ebaf17d3083a97e02ecb42
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
09afc2e4ea4f22dc1ef439244f6f0f1572e5a676 18-Jul-2014 Dan Sandler <dsandler@android.com> Defend against null ApplicationInfos.

Bug: 16303792
Change-Id: Id2d7a70f92718ecda8e3ff418c4e109f6982a75f
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
7b41467704f941b11af6aace3e40993afc7f6c6f 18-Jul-2014 John Spurlock <jspurlock@google.com> Zen mode filtering should use new usage constants.

Refactor stream-based calls to usage-based calls.

Bug:15279516
Change-Id: I3f7757d8123c14670e2ad5f8e6aa4e9803efe7ec
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
329a85ba903a6d46f332c3db106c3ffb4cef851e 18-Jul-2014 Christoph Studer <chstuder@google.com> Merge "Cancel notification group children when summary is canceled" into lmp-dev
6ae82a747c77fbdba45d2deaf127ef068c294aa1 16-Jul-2014 John Spurlock <jspurlock@google.com> Add a zen-specific event sink, include in dumpstate.

Useful for tracking zen events (since boot) that are
too old to be included in the standard log.

Change-Id: I91633d35b26091bb18523a76ebdba9d286d0cd41
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e4ef156b61fcdbeb4eb62a1426e1b56cbd95c1b2 04-Jul-2014 Christoph Studer <chstuder@google.com> Cancel notification group children when summary is canceled

Bug: 15865959
Change-Id: I29f8f5357f85eac3d4129ff9a15168f52caaa613
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
50806fc4ceff4bb093a18bdecb506163e68b9cbb 15-Jul-2014 John Spurlock <jspurlock@google.com> Zen: handle exit conditions across reboots.

- Use the persisted exit condition (and a new
persisted exit component) to immediately resubscribe
to the manual exit condition (if present)
- Fire false immediately for old countdown conditions.
- Add a new zen lens to noman dump, and a bit more info.
- Refresh the current exit condition when reopening the panel.

Bug:15844990
Bug:16212455
Change-Id: I8bfaf1b2a6cf3d8818002a9db5c527ad3aa4c05c
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
54bbef435ed857fc68941672799fc8001c101119 10-Jul-2014 Chris Wren <cwren@android.com> Implement application-level high priority bit.

Enable checkbox in settings and wire it to NotificationManagerSerivce.
Add RankingHelper to collect ranking configs and logic.

Bug: 15080024
Change-Id: Ib1d3b0b5ca4fcfdc52c2cb6838a009b9addf1094
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1d599da8424cef8d07cb4c533bd212d992d8f676 12-Jun-2014 Christoph Studer <chstuder@google.com> NotificationListenerService API: Avoid unnecessary allocations

Instead of producing Ranking objects, RankingMap just populates
them now, allowing developers to re-use objects and avoid
unnecessary allocations.

Also rename isInterceptedByDnd() to meetsInterruptionFilter(),
since DND is not a concept anymore.

Bug: 15415840
Bug: 16099064
Change-Id: If9861cbdf14593e641a4d4ffd1b967647eb8e2b8
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ae641c9ccd3f81214cee54a5f13804f1765187ad 01-Jul-2014 John Spurlock <jspurlock@google.com> Implement new volume UI design.

- Add segmented zen-mode picker to the rocker UI.
- Add a new "no interruptions" value to the zen setting.
- Implement expandable condition subpanel on the rocker UI.
- Remove the old circle&slash icons.
- Suppress alarm sounds if in "no interruptions" mode.
- Add warning re: alarms to the condition UI.
- Allow rocker UI to display over the keyguard.
- Remove Notifications QS tile.
- Realign volume rocker to the top of the screen.
- Add support for new "days" sleepMode.
- New icon policy rules for "volume" slot.
- New important icon (star).

Associated Settings change:
I6ed56791784968adfbd684f490dbbebed285a2dd

Bug:15831713
Change-Id: I35afe38646f04d2ba0dbac11c2c6356120a33694
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d5092bcb11c28f656eb470bd9b74585287fd75b4 03-Jul-2014 Christoph Studer <chstuder@google.com> NoMan: Allow notifications to transition !ZEN -> ZEN

Bug: 15979100
Change-Id: Ifd620caf2e00f8cd3d9f1458b93585a454af4b74
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1cd5add16c6e1904434f8120647da01df743790b 03-Jul-2014 Christoph Studer <chstuder@google.com> Fix 'stuck notification' bug

Apply implied flags before notifying listeners.

Bug: 15589158
Change-Id: Ie1c7374fa562ff62725361fb0dc8b0d1a6725618
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
25e2d24f24040e58a61169db797f760b16c11f5d 27-Jun-2014 John Spurlock <jspurlock@google.com> Add optional package filtering to notification dumpsys.

$ adb shell dumpsys notification p <fragment>

Change-Id: Iddcc45066187e0e9d5812275de132dd6bba2a135
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e71fefcc8b382947f6f6a8bf816b3889fb368fed 24-Jun-2014 Christoph Studer <chstuder@google.com> Remove notification APIs from StatusBar service

Bug: 15324972
Bug: 15436573
Change-Id: I838370a23fb07cb876e08c41ef11653f2658719e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
26b6db36a3543072d358ae58486b09792318828c 16-Jun-2014 Christoph Studer <chstuder@google.com> am afaf0c54: Prevent duplicate notifications

* commit 'afaf0c54731e126affcd3319a1d9a4f0da63411e':
Prevent duplicate notifications
c5115556707d24dfbe6cbef8f3e9476b6c5e3021 12-Jun-2014 Christoph Studer <chstuder@google.com> Prevent duplicate notifications

Don't trust mNotificationData being sorted consistently
at all times...which it actually should. But apparently isn't.

Instead of using binary search to find the previous instance of
the notification when it's updated, use a simple linear scan.

Bug: 15589158
Change-Id: I7a09d0c64e35bd1930b8992d19da1393f4e4bb4e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
90c392fd2dfb354975a504f5890081ab41022fc6 11-Jun-2014 Kenny Root <kroot@google.com> resolved conflicts for merge of 579ace03 to master

Change-Id: I461879359824036ec861ad9b5b8804ae814179a9
9f637d10959490c3a28e0f40330e97eb67e954d7 10-Jun-2014 Griff Hazen <griff@google.com> Reduce notification service historical archive size to 1 for watches.
To remove the memory footprint

Bug: 15536759
Change-Id: I081bd962fef689b5d8ed126208499d56ebf4ae38
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
89b6bf5a118322d923cb9349515f06e32003c6ef 05-Jun-2014 Justin Koh <justinkoh@google.com> DO NOT MERGE Readd removal of notification listener limit on posting

Listener packages are allowed to post > 50 notifications

This reverts commit 500a6b0ca68aaad6140b5af2dae94349be9f7aeb.
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
92e49599e965e015860f0bc5e2950a5b8a562489 05-Jun-2014 Justin Koh <justinkoh@google.com> am c7a5d4a9: am 8200b667: Merge "Revert "Add check to allow notification listener packages to post >50 notifications"" into klp-modular-dev

* commit 'c7a5d4a920a7cd865da93ba56c35403c43c69971':
Revert "Add check to allow notification listener packages to post >50 notifications"
500a6b0ca68aaad6140b5af2dae94349be9f7aeb 05-Jun-2014 Justin Koh <justinkoh@google.com> Revert "Add check to allow notification listener packages to post >50 notifications"

Broke build.

This reverts commit 2dbd36fc7f9341ecef51c2ed96a0f21b046f5a8d.

Change-Id: I2fdf1de21b6598f85bbd94acef44e771b2df9f42
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
29dee1bbba40976f4bb1122d134a0444b0ecb953 05-Jun-2014 Justin Koh <justinkoh@google.com> am 2304bf4c: am 2be3d6f9: Merge "Add check to allow notification listener packages to post >50 notifications" into klp-modular-dev

* commit '2304bf4cd4e377994d80f55871fd31f82bb4f646':
Add check to allow notification listener packages to post >50 notifications
5116a821b9507b16bdfa8549a65556493813e111 04-Jun-2014 Chris Wren <cwren@android.com> Disable the attention light on devices that do not have it.

If the attention and notificaiton light are mapped to the same
physical LED, then pulsing the attention light can turn off the
notification light. See bug for detailed discussion.

Bug: 12900389
Change-Id: I2703af23f50ecc3e92140b9843aaf340d520bce5
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a344656a010dc3c88aef39109f1ac459792e7607 04-Jun-2014 Chris Wren <cwren@android.com> A notification that emerges from Zen Mode interception should beep.

If a notificaiton emerges from Zen Mode due to a ranking
reconsideration (possibly because a long-running query resolved an
important person) then it should get the oportunity buzz, beep, blink,
and send accessibility events.

Save what we need to know about the old notificaiton record on the new
record so we don't have to hold onto it.

Bug: 15383458
Change-Id: I15c7834fef03ff6a676e78e9d2caae24f00720ef
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
2dbd36fc7f9341ecef51c2ed96a0f21b046f5a8d 04-Jun-2014 Justin Koh <justinkoh@google.com> Add check to allow notification listener packages to post >50 notifications

Bug: 13433398
Change-Id: I77abf19982add240e1bbe8196fbe148d32884f68
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
856edebad73560e9b1cce021a7de9a0470d07176 02-Jun-2014 John Spurlock <jspurlock@google.com> Zen: Stateful condition panel.

When DND is on, expanded panel shows the current time
condition, or time remaining. The last time bucket
selected is remembered as the default option for the
next time.

Move the server-side countdown helper into a proper
condition provider, but register it in-process as a
system provider.

Move common countdown condition parsing into ZenModeConfig
to reuse from system components.

Keep the manual exit condition around in zen mode config
and add plumbing for getting / listening to the
controller.

Keep the last QS detail panel around instead of
recreating it every time.

Fix the time condition's plus and minus button
enabling logic, and enhance the click handler to
deal properly with the next or previous bucket.

Bug:15344758
Change-Id: Ie7018a1c20e20f6d7e5f9e7874188374e6f8e2ab
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
52eba54eca02ef0b38e91490d10f9a697cbcb502 02-Jun-2014 Chris Wren <cwren@android.com> Apply Zen Mode later, after we've found the old record.

Copy the extracted signales from the previous record to the new
record. Do this before the signal extractors are called so that code
can decide what to do with the information.

Bug: 15383769
Change-Id: Ifa24fa0e4380f08979c2126b63d29794aa50a787
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
333a61c3a5a83fe9c50ebeb5c947317f61385b7b 28-May-2014 Chris Wren <cwren@android.com> Track Zen Mode status in the NotificationRecord

This requires the record to be present in makeRankingUpdateForListener,
however, if the ranking object is created before the post to the handler,
then no cloning is necessary.

Depends-On: I907a1ff28123219db1c08889d723ad1b70b191ab
Change-Id: I51fcf689ddbee7715e3387b865f18a715887c943
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
470c1accf5a54f9844a779eafab74e63c09342b5 21-May-2014 Chris Wren <cwren@android.com> Fix a concurrency bug in the ranking reconsideration.

If we rely on mNotificationList to be sorted, then we cannot allow
records to change without a corresponding call to sort. Currently
RankingFuture may modify records in a separate thread, while the sort
doesn't happen until later. This creates a window for race conditions.

Instead, RankingFuture should record operations to be performed on the
record that will replayed later, in a transaction along with a sort.

We can't simply overwrite the old record completely because another
future may be concurrently modifying a different aspect of the record.
Two futures that attempt to modify the same aspect will be serialized
and the second will overwrite eventually the first.

Change-Id: I9223cabdc60f72d8e37e6d8119bea1e0127185c0
(cherry picked from commit 77d3e0d0297caca5358879d36e8ba77710eb8e82)
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
3e144d3dfcf209349ead9995877f53feb0b5a66e 22-May-2014 Christoph Studer <chstuder@google.com> NoMan: Allow SysUI to register as listener

Expand ACL of INotificationManger.registerListener() from
system only to system or SysUI.

Also call onListenerConnected() on listeners connected via
INotificationManger.registerListener().

Bug: 15131411
Change-Id: I8f2ce34325ad72c7740b383de2ebb9fb88dea5d3
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
71f18fd1b64071e486bafff237b1f87a56d4aead 20-May-2014 Christoph Studer <chstuder@google.com> SysUI: Use SBN keys instead of IBinder keys DO NOT MERGE

In preparation of migrating to NotificationListenerService,
remove dependence on IBinder keys for notifications and switch
to SBN.getKey() instead.

Bug: 15131411
Change-Id: Ic272e4a05fde6481c734144c5b34c49b2f021649
(cherry picked from commit 7c96ae873d9a54ebaeb5b7ef21b48224dc42d094)
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cee44ba418bef83571349acb2d24ef29833502e0 20-May-2014 Christoph Studer <chstuder@google.com> Simplify NotificationListenerService API

Use ParceledListSlice to send the list of active notifications
from NoMan to NotificationListeners.

This allows us to simplify the API to what it was before
introducing the "String[] key" workaround for dealing with large
numbers of StatusBarNotifications.

While we're at it, rename Ranking.getIndexOfKey to something that
makes more sense.

Bug: 15126927
Change-Id: I02c2087978c6c4ec1198be496c6250a66143ecb3
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
7509733c8dfb4e65dbb45ab582e09d599dfaaa28 16-May-2014 Dan Sandler <dsandler@android.com> Elide extras strings from noman dumpsys output.

Bug: 14292528
Change-Id: I19cfb6b692e6901fa7f115ea675b1b03fc5ba176
(cherry picked from commit 44de3cfc08428378b93172a2b03f9785a3638678)
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b979f23c5970138d75d5c2e76ded1470f7a8eb83 16-May-2014 Dan Sandler <dsandler@android.com> Elide extras strings from noman dumpsys output.

Bug: 14292528
Change-Id: I19cfb6b692e6901fa7f115ea675b1b03fc5ba176
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d1dd0277552b8729154ffe67c14e7dcfb833b04a 20-May-2014 Chris Wren <cwren@android.com> add ranking information to the dumpsys info

Change-Id: Ie08186066821a10feef010fd7967150b5517cd54
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
05ad48206a082057e17723d32493c153faa6881e 16-May-2014 Christoph Studer <chstuder@google.com> Add ZEN and speedbump to NotificationListenerService

Change-Id: I39fae5d77863e0d10cf236a096cc589167d146d3
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d04cf4ccf426f70d80e98b46dc74c4dfb18f338f 15-May-2014 Christoph Studer <chstuder@google.com> Merge "Track notification airtime"
154f8283656d6c879a568fe4be19286dbb2c7121 14-May-2014 Chris Wren <cwren@android.com> Merge "Add intrusiveness signal extractor."
5190c0fefac9923931b5c1c02cab2d00c2d6b82b 08-May-2014 Chris Wren <cwren@android.com> Add intrusiveness signal extractor.

Temporarily bump noisy things to the top so the user can find them.
This is the first example of a delayed ranking reconsideration.

Change-Id: I07271ba197101ad462e4f99fb7c369a39c8c2e2f
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
ffeb0c38145709b51dee0254b770bccc9083ea5c 07-May-2014 Christoph Studer <chstuder@google.com> Track notification airtime

...and write it together with posttime to the
SQLite log.

Bug: 13672846
Change-Id: I605447f89a0c89782a320c298ddb59cbb8994367
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
af8d6c44f06d2f8baac2c5774a9efdae3fc36797 07-May-2014 John Spurlock <jspurlock@google.com> New quick settings implementation.

Bug:14133785
Change-Id: I7f57f8e7ebcc3e1a06fa5204f477470f14299e1f
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
9bbc0ca0ab5e381be8a05ee457f2b93a3f0d63bc 12-May-2014 Chris Wren <cwren@android.com> Merge "notification ranking infrastructure"
f953664dc17dca23bd724bd64f89189c16c83263 17-Apr-2014 Chris Wren <cwren@android.com> notification ranking infrastructure

Added an ordered list of notifications (n.b. a complete ordering).
Added a mechanism for ranking to be updated asynchronously
Added onNotificationRankingUpdate to NotificationListeners
Added an opaque order update object and a convenience comparator that
uses it to sort notifications for listeners

Repurpose scorers to be ranking preprocessors. The preprocessors will
perform heavy-weight validation of the notification object and memoize
the results to improve efficiency of the ranking comparator.

Current internal comparator implements status quo ordering, except
that notes with a valid contact sort to the top of their priority
bucket.

Change-Id: I7244c65944a9657df41fb313b3cb5a52e149709d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
2509be2bb7f00d615e7e8770c713a36fcf8b9ee1 09-May-2014 Christoph Studer <chstuder@google.com> Merge "Preserve notification stats on update"
061dee22df6af640db6f236d0929d6ccf9b455af 09-May-2014 Christoph Studer <chstuder@google.com> Preserve notification stats on update

Change-Id: I519b31e83c32ac00e7c5838abbc5e3127430106b
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b325c80d3da0c14107597a4c5423dba938e1a633 08-May-2014 Dan Sandler <dsandler@android.com> Merge "Quantum notification improvements."
1c3f81fde944d615d566db6fbc493b25e6d2f472 16-Apr-2014 Christoph Studer <chstuder@google.com> Record notification events to a local SQLite DB

Bug: 13672846
Change-Id: I911573ba943487b3f4f18349d318215bd183d991
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
26e81cf14bf32585742cbb75ac14045acaab2692 06-May-2014 Dan Sandler <dsandler@android.com> Quantum notification improvements.

New API introduced here: Notification.color (and
Builder.setColor()), allowing apps to specify an accent
color to be used by the template. The Quantum templates
(which are now the only kind we support) use this when
creating a circular background to draw behind the smallIcon
in the expanded form.

Additionally, the quantum and legacy templates are no longer
in superposition; all apps using Builder will get quantum.

Change-Id: Iac5e2645cc5c2346ed458763f2280ae9c6368b62
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
983ce97a5dd82688966e783a2c26f34550cfafa5 05-May-2014 Christoph Studer <chstuder@google.com> Merge changes Iffd15e95,Id2db95ec

* changes:
Log notification clicks
Add userId to StatusBarNotification key
c8d7ab9ff9f1ca0790d6fd9b9a2076c3eb63a795 05-May-2014 John Spurlock <jspurlock@google.com> Log all notification interceptions.

Change-Id: I036a4b5eb7c5a3ce2addb0a16d9d6806e3952929
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
3b98b3f1f85aff0c84ebef4dd497c146d1b4d248 01-May-2014 John Spurlock <jspurlock@google.com> Implement long-term condition subscriptions.

Bind long-term conditions (like "in a meeting") to enter/exit
zen mode automatically.

Persist automatic condition subscriptions to maintain them across
reboots.

Normalize condition state binding: true => enter zen, false => exit.

Change-Id: Icba2b8b25c0a352ae8215f4c0a324e4f966c0165
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
03b87a2f40c26948b7b0c9409c33ad44857218cf 30-Apr-2014 Christoph Studer <chstuder@google.com> Log notification clicks

Emit notification_clicked log events when a notification
is clicked from SystemUI.

Also refactor the onNotificationClicked method to work with
a key instead of individual notification params.

Change-Id: Iffd15e95d46371b2ae7bfd00b2c348d9f4cf5d14
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1c923a386ee4d8c31cc289f8628b8fc46bf08e86 27-Apr-2014 John Spurlock <jspurlock@google.com> Force condition provider unsubscribe when exiting zen mode.

Bug:13743109
Change-Id: I3c205067498a86e2862a0c545bc38e41682693d5
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e77bb36d48b6b8b5c3bb6a1195aca469bb237919 26-Apr-2014 John Spurlock <jspurlock@google.com> Wire up condition providers to zen mode exit triggers.

Bug:13743109
Change-Id: I4e45d7050d1f9aaa379f46379a3203e61e216a3d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
7340fc8665ae3f9f1978f42aa0e5e1da85036158 25-Apr-2014 John Spurlock <jspurlock@google.com> Introduce condition provider services.

Add the condition provider interface, base class, and associated
system metadata.

Pull out common service management code into a reusable helper,
used by notification listeners and condition providers. The
helper, ManagedServices, is now completely self-contained - it
has no dependencies on NoMan or NoMan abstractions.

Bug:13743109
Change-Id: I6856d40f0a2ead78ac9b5707568559a57e7eb009
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
b408e8ecd22853faa70e97d0596aac9e7dcf5596 24-Apr-2014 John Spurlock <jspurlock@google.com> Move notification listener management into helper.

Part of a larger effort to reuse service management code. This is
mostly algebraic, simply move code related to listener management
into a new helper, and cut the backreference to NoMan. Put
user-profile code into reusable inner helper, and common uid-checking
code into a new static util helper.

Resist the urge to rewrite / reformat, but replace HashSet with
ArraySet.

Bug:13743109
Change-Id: I59e0131f632c3bbf555b5276dc5092422113cdc3
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
056c519df1dfb8fdc57daddfdf09bc0e1ffddac4 21-Apr-2014 John Spurlock <jspurlock@google.com> Do not disturb: persist user config.

Load and store user configuration for do not disturb. Separate
out service-related aspects into new helper. Make config availble
over NoMan for settings.

Implement phone + message based filtering (package whitelist for now).

Implement automatic enter/exit zen mode overnight scheduler.

Bug:14211946
Change-Id: Ib28aab0e4c5c9a5fd0b950b2884b1ab618fdfeca
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
8fd7f1ed7c11d35b3f2a97878e68ee38a551dd15 11-Apr-2014 Christoph Studer <chstuder@google.com> Rename basePkg to opPkg

...and actually populate the field correctly.

Change-Id: I3ce52efedb919d6af75dc9c3532e47764c467cac
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
92b389da2a60ac51e804031494fea177fc1c47be 01-Apr-2014 Christoph Studer <chstuder@google.com> Write eventlog entries for notification visibility

Keep track of notifications shown in the notification panel
and log them via eventlog.

Added the following eventlog tag:
* notification_visibility_changed

Bug: 13442201
Change-Id: Ifb74ec2492967dc787b4de86db7d7f00be6c7f74
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cfd3cd6df375793d714fe3b6570791e377cab1e5 08-Apr-2014 Kenny Guy <kennyguy@google.com> Merge "Pipe notifications from related users to listeners."
a263e4e438746f91fb78857bd569ba4f796a346d 03-Mar-2014 Kenny Guy <kennyguy@google.com> Pipe notifications from related users to listeners.

For Listeners built against L or greater
Send notifications from related users to listeners.
Return notifications from related users getAllActiveNotifications
Cancel notifications from related users in cancelAllNotifications
Deprecate StatusBarNotification.getUserId() and expose getUser()
as APIs should use UserHandles.
Deprecate cancelNotification that takes package, id and tag
in favour of one that takes key.

Fix bug that notifications from related users didn't
trigger sounds.

Change-Id: I1b1c20c9f305b8f3c4047bc5720d8e99cdedfe70
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d624a443ec5662d2bf812b6992e783bea225d36d 07-Apr-2014 Christoph Studer <chstuder@google.com> Merge "Write eventlog entries for notification panel visibility"
760ea554d0022fd88bbe13e3ef7c75cbe8613af6 21-Mar-2014 Christoph Studer <chstuder@google.com> Write eventlog entries for notification panel visibility

Change-Id: Ie7e15ed15739cb5f057c900e1cadf90824b2b4ef
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
d89188d68e678f1f7bcfdae9a9a9fa5b946bfc32 03-Apr-2014 Christoph Studer <chstuder@google.com> NoManService: More efficient notification update

Instead of removing the old notification and inserting the
updated notification afterwards, replace the old notification
in-place.

Change-Id: I88962fd2452de191c1d63c142719194282568dcc
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
2a764949c943681a4d25a17a0b203a0127a4a486 02-Apr-2014 Kenny Guy <kennyguy@google.com> Rename related users to profiles.

Rename the related user concept as profiles.
When returning profiles of a user include the
user as a profile of itself.

Change-Id: Id5d4f29017b7ca6844632ce643f10331ad733e1d
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
546bec8ebf2cf865e88d02cc8cb29563ad224967 14-Mar-2014 Christoph Studer <chstuder@google.com> Notification usage stats

First cut of gathering implicit notification signals and computing
running stats.

Tracks:
1. Post, update, remove by apps
2. Click, dismissal by users

Stats are aggregated on user, user+pkg, and getKey() levels.

Current stats are printed as part of 'dumpsys notification'.

Change-Id: I06ecbf76e517509895f2f9eea5b9d19bf9a34975
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
5579ec33eb317a19ad80929169b2b329b147d98b 28-Mar-2014 John Spurlock <jspurlock@google.com> DO NOT MERGE Enhance the NotificationListenerService api.

Add to NotificationListenerService:
- getActiveNotificationKeys() : String[]
- getActiveNotifications(String[] keys) : StatusBarNotification[]
- cancelNotifications(String[] keys) : void
- onListenerConnected(String[] keys) : void

Add to StatusBarNotification:
- getKey() : String

Bug:13562828
Change-Id: I9da222cb4af22864bc0ecdecc3f121bced0723d6
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
a4294297d46cc0b9f45897bc688c267502cce3ef 24-Mar-2014 John Spurlock <jspurlock@google.com> Enhance the NotificationListenerService api.

Add to NotificationListenerService:
- getActiveNotificationKeys() : String[]
- getActiveNotifications(String[] keys) : StatusBarNotification[]
- cancelNotifications(String[] keys) : void
- onListenerConnected(String[] keys) : void

Add to StatusBarNotification:
- getKey() : String

Bug:13562828
Change-Id: Idd9605dad8f942d68b4b32ab9625faf6c8642db9
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
350159c65a52092db04f1b8efce6943f61e50e73 27-Mar-2014 Adam Lesinski <adamlesinski@google.com> resolved conflicts for merge of 6984e4f9 to master

Conflicts:
services/core/java/com/android/server/notification/NotificationManagerService.java

Change-Id: Ief1bf339cf7d75094c9a169264c015b1f286ed63
e824026554f1e2a8df8d27f703bf8e6a2d6dad19 27-Mar-2014 Adam Lesinski <adamlesinski@google.com> Fix a race in NotificationManager with Listeners

After being bound to, a NotificationListenerService could
make a call into NotificationManagerService before having been
added to the list of active services.

Bug: 13644375
Change-Id: I4ed920d165f46d009f91e28ca13c3926563cd110
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
eeb397b77f249045b02fe3014479a9c1bf001d0d 25-Mar-2014 John Spurlock <jspurlock@google.com> Zen mode updates.

- Now only two modes, no more ZEN_MODE_FULL.
- Alarms are allowed by default.
- Interstitial dialog cleanup to follow current UX.

Change-Id: I8e4c8f64854dabfef69ad33b3eb35bee07e55ef7
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
2471abec78a29b5a7b9b9e3e6c061f4be0964e9a 25-Mar-2014 Adam Lesinski <adamlesinski@google.com> am e77786d5: am 99d60784: am 415e6f8e: Merge "Fix issue with early service start" into klp-modular-dev

* commit 'e77786d51f574ca7bbb45df136f92fc7c7d06ffe':
Fix issue with early service start
a6db4ab6193626c880970572a0d03db511d403af 24-Mar-2014 Adam Lesinski <adamlesinski@google.com> Fix issue with early service start

NotificationListener services would start too early
and crash due to system_server not being ready.

Bug: 13439345
Change-Id: I86ee93b50d016bfa0119e21a8cde8635212b16a4
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1af30c7ac480e5d335f267a3ac3b2e6c748ce240 10-Mar-2014 John Spurlock <jspurlock@google.com> Add stream-level suppression to vibrate/audio services.

- Add new audio restriction layer to app-ops. Restrictions add
additional constraints to audio operations at a stream-level.
Restrictions do not affect the persistable state, and are purely
additive: that is, they can only impose additional contstraints, not
enable something that has already been disabled. Restrictions
also support a whitelisted set of exempt package names.

- Add new audio stream-level checks to app-ops.

- Implement a provisional OP_PLAY_AUDIO suppression to three
java entry points MediaPlayer, AudioTrack, & SoundPool.

- Enhance vibrator api to take stream information as an optional
hint - the constants correspond to AudioManager stream types.
OP_VIBRATE now supports the stream-level restriction check.

- Simplify Vibrator subclasses by adding default implementations
for two .vibrate calls.

- Migrate NoMan's zen-mode control to use the new app-ops
stream-level restriction mechanism.

Change-Id: Ifae8952647202f728cf1c73e881452660c704678
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e6a7d93420406cdbdf1b88b9635344dea52b4650 13-Mar-2014 John Spurlock <jspurlock@google.com> Add more information to existing notification_* events.

Include calling UID/PID in the existing
notification_{enqueue/cancel/cancel_all} event logs.

Include a new "reason" arg for cancel + cancel_all to
identify listener vs noman vs statusbarmgr calls.

Found and fixed a cancelAll path (from statusbarmgr)
that was not logging at all.

Bug:13442201
Change-Id: I2e1f875076a96b1fe3b86e8990641efb1cadfcfb
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
3a7c4a5669420ae9b01eda88d1d60114e99d70ff 03-Mar-2014 Kenny Guy <kennyguy@google.com> Show notifications from related users.

When filtering notifications for user include those for users that
are related to the current user.
Pipe through user id so we know which user the notification is for.

Change-Id: I4e2657c23bd7b611d450be5a1f9457824bc062cb
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
1f97d0ae87dc1891e2417e2e2338a870c4985336 05-Mar-2014 John Spurlock <jspurlock@google.com> Balance calls to setStreamMute.

Otherwise can get into a situation where ringer volume appears
permanently muted (until reboot).

Change-Id: I58c09f68dc02cba4de72e3a024b72484b9b9bc82
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
c323b8d4d68008cc2c6d143e30db7d89245ec527 05-Mar-2014 John Spurlock <jspurlock@google.com> Block calls in limited interruptions mode.

Calls should be blocked by default in this mode, not allowed.

Change-Id: Ia628389857c5df90cec820efd0ca81e1d949631e
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
718e39f1dcd9c2377af8f8a10bfe20e2164555fd 28-Feb-2014 Will Haldean Brown <haldean@google.com> am 987fb9cd: am 9d50308b: am 41044e5e: Merge "Maintain binding to crashed listeners from NotificationManagerService." into klp-modular-dev

* commit '987fb9cd299bf0bf73bec233eaf184fb4e8353ac':
Maintain binding to crashed listeners from NotificationManagerService.
866b25425e84f72911abc0e0ff8141f11c0980cc 28-Feb-2014 Will Haldean Brown <haldean@google.com> Maintain binding to crashed listeners from NotificationManagerService.

This fixes the logic on the death handlers for notification listeners,
and doesn't unbind from the listener services so that the system will
bring them back up again.

Bug: 12587702
Change-Id: I44ce250e0e1c2583836dc823d9a333dabec51df9
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
e677d7113f6627161653f686b6381d2eef4d502f 13-Feb-2014 John Spurlock <jspurlock@google.com> Introduce zen mode.

- New global zen mode setting with three values:
ZEN_MODE_OFF, ZEN_MODE_LIMITED, ZEN_MODE_FULL
- Status bar icon (on lhs) when in _LIMITED / _FULL
- Rules are hardcoded for now:
_LIMITED = intercept all notifications except calls/alarms
_FULL = intercept everything
- UI affordance in shade to set mode
- Only one exit condition: "Until you delete this"
- Intercepted notifications:
- appear darker in the shade
- do not cause sound/vibration
- do not fire fullScreenIntents
- do not contribute an icon to the status bar

Change-Id: Ic36c95982b483432006bf9dab102a31370382aa9
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
c4aee98a62f400dd9f6f964d26d739d409212775 12-Feb-2014 John Spurlock <jspurlock@google.com> Improve error handling in listener services.

Check explicitly for null listeners in NMS, throwing
IllegalArgumentException (on the small list of exceptions
that survive RPC boundaries) with a message.

Normally this situation is caused by listeners that attempt to
perform NM-related actions before they are bound. Check for
this case in the base NLS class and avoid the call to NM if we
know it will fail.

Although it's tempting to throw an IllegalStateException on the
client side, preserve the existing semantics for backwards-compatibility
purposes. That is, silently fail (or return null) - and provide a
log warning.

Bug:12805707
Change-Id: I0d92fd0d460a8592e8a23fd8fd718ae2ba3bd4c7
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
da9a3bed8e1aa7d7867291a123466bb0a3be5bb0 12-Feb-2014 John Spurlock <jspurlock@google.com> Improve error handling in listener services.

Check explicitly for null listeners in NMS, throwing
IllegalArgumentException (on the small list of exceptions
that survive RPC boundaries) with a message.

Normally this situation is caused by listeners that attempt to
perform NM-related actions before they are bound. Check for
this case in the base NLS class and avoid the call to NM if we
know it will fail.

Although it's tempting to throw an IllegalStateException on the
client side, preserve the existing semantics for backwards-compatibility
purposes. That is, silently fail (or return null) - and provide a
log warning.

Bug:12805707
Change-Id: I0d92fd0d460a8592e8a23fd8fd718ae2ba3bd4c7
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
cab8617b8ccea3a99b1ee15e15915c512a10c738 11-Feb-2014 Jeff Brown <jeffbrown@google.com> am 25df673b: am 1b51c9cb: Merge "Make SystemService constructor take a Context." into klp-modular-dev

* commit '25df673b849de374cf1de40250dfd8a48b7ac28b':
Make SystemService constructor take a Context.
b880d880c6cd989eacc28c365fc9a41d31900da1 11-Feb-2014 Jeff Brown <jeffbrown@google.com> Make SystemService constructor take a Context.

This change simplifies the process of initializing a SystemService
by folding the onCreate() step back into the constructor. It removes
some ambuiguity about what work should happen in the constructor and
should make it possible for services to retain most of their final
fields after refactoring into the new pattern.

Change-Id: I25f41af0321bc01898658ab44b369f9c5d16800b
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
5d2eeb111a6e1e46a1fd25c73f55caa408fa8303 16-Jan-2014 John Spurlock <jspurlock@google.com> Defend against malformed broadcast in NotificationManager.

Bug:12583158
Change-Id: I4b10e19b9a23ff8e950006b3b3496bd6800346ea
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
9158825f9c41869689d6b1786d7c7aa8bdd524ce 22-Nov-2013 Amith Yamasani <yamasani@google.com> Move some system services to separate directories

Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
/frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java