History log of /frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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