History log of /frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
87c42773602f64d2ebae2631cffed7b88232dfbe 16-May-2016 Julia Reynolds <juliacr@google.com> Throw exception on rule creation failure.

Bug: 28775583
Change-Id: I98cf90afd86e307846970f1ede7f072eb8b70c7f
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
d82e981cf3003334affbb4454d8344c0a21bc124 19-Apr-2016 Julia Reynolds <juliacr@google.com> Don't call into audiomanager holding a zen lock.

Bug: 27642196
Change-Id: Ib510f2ddf966f36b3670290a4f3f695bf6b7810e
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
7f2f441783c3924637998f3692439722c423f199 01-Mar-2016 Julia Reynolds <juliacr@google.com> Protect against a lack of metadata.

Change-Id: Idc28ac451567e8ee4772d9db3009102d781e6331
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
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/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.java
3fe81be01584b2fd477464198cc838d57e37762c 03-Feb-2016 Julia Reynolds <juliacr@google.com> Make 'total silence' more silent.

Bug: 25428208
Change-Id: Ibb5288430dc418dbb784a0fd7598612506285782
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
0ae2b0b47d49784e4ef12c04fb49fef45959933f 14-Jan-2016 Julia Reynolds <juliacr@google.com> Verify zen rule owners before persisting rules.

Change-Id: Ib89a17aa9d460db268b207828aa23c7802cfd7e9
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
9a25da192e12e3226e0b52dfc44bcac9a0283f73 06-Jan-2016 Julia Reynolds <juliacr@google.com> Send less unnecessary broadcasts.

Protect the broadcasts we do send.

Change-Id: I440a7accfc4509512063b663c0418a29f06ef09e
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
5a43aaa6a42741510db21671c54b2891f9f284a4 15-Dec-2015 Julia Reynolds <juliacr@google.com> Clean up orphaned zen rules, synchronize better.

(If a rule was restored to the device but the user didn't restore
the matching app).

Bug: 25472361
Change-Id: Icaefd0d1fca78ff351937fbe553ae72922a5457f
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
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/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.java
8b14288c940d8edf463a54fe7ab9f326e45f03be 09-Oct-2015 Julia Reynolds <juliacr@google.com> Merge "Remove rename automatic zen rule."
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/ZenModeHelper.java
2dafb47c528ac6076d0ae62f8f2166c223e323ec 07-Oct-2015 Eric Laurent <elaurent@google.com> am bbf804ca: am c6865806: am f5d3f960: am 2a6f1d4a: Merge "ZenModeHelper: fix cross deadlock with AudioService" into mnc-dr-dev

* commit 'bbf804ca0dc173c73df300c177aff344c9e4074f':
ZenModeHelper: fix cross deadlock with AudioService
f5d3f96001b42ff902022ebf4d97f9ab5e1f26f8 07-Oct-2015 Eric Laurent <elaurent@google.com> am 2a6f1d4a: Merge "ZenModeHelper: fix cross deadlock with AudioService" into mnc-dr-dev

* commit '2a6f1d4af39a72abecf16cc0a95feda7431afc07':
ZenModeHelper: fix cross deadlock with AudioService
56106ff337e056d2daa5862545f4a06796d9e9a1 30-Sep-2015 Julia Reynolds <juliacr@google.com> Add id and creation date to Zen rules.

Bug: 22977552
Change-Id: Ic79714ebbcc895e55ee87ccfc0e03b1735255ef3
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
e0ced4da1990583d6438cb3e99a8e16b5d1e8cc6 01-Oct-2015 Eric Laurent <elaurent@google.com> ZenModeHelper: fix cross deadlock with AudioService

Processing ZenModeHelper.setConfig() synchronously in
ZenModeConditions.onConditionChanged() can cause a cross deadlock between
ConditionProviders.mMutex and AudioService.mSettingsLock.

Add a method to set Zen mode config asynchronously.

Bug: 24528290.
Change-Id: I9c1701ca6bef084527821175d84002b612241995
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
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/ZenModeHelper.java
8ac63037900e1ceed56fffa7f73b6302de4fda70 31-Aug-2015 Julia Reynolds <juliacr@google.com> Be more proactive about processing zen rules.

This compensates for the fact that zen rules are multiuser
and the zen_mode setting and ringer mode aren't.

Bug: 22875494
Change-Id: I8cdd791eabe13fc51d0c7544beecc96734b06276
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
e646ba838cda5d2f71e2f4a2512bc8437fda478a 25-Aug-2015 Zach Johnson <zachoverflow@google.com> am 3f7cfb2c: am 632c240f: am 3f62358b: Merge "*ring ring* Who is it? Destiny? I\'ve been expecting your call..." into cw-e-dev

* commit '3f7cfb2cfb3831914b8a8d6a340077415c7968b9':
*ring ring* Who is it? Destiny? I've been expecting your call...
f1b48144a970807d4cb63c308f9a38de535f92ed 25-Aug-2015 Zach Johnson <zachoverflow@google.com> *ring ring* Who is it? Destiny? I've been expecting your call...

https://www.youtube.com/watch?v=7VFPtY7hiGw

Allow USAGE_NOTIFICATION_RINGTONE regardless of effect supression
component, because otherwise we can't use the system implementation of
ringtones (audio or vibration). If a platform wishes to turn supress this,
it can be disabled through the default zen configuration if necessary.

Change-Id: I02a89376b40c6eecde2468c93898b4a821315e64
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
9b11fdb56dd8b0250e077c1713434b388d8cd523 31-Jul-2015 Julia Reynolds <juliacr@google.com> Store ringer mode on entering DND mode so it can be restored on exit.

Store the value in Settings now, so it's not lost on reboot.
Bug: 22338093

Change-Id: Icc843ef2bf735c23aabf9ceddd82283d51424220
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
25d01ee5156bb283fd62f042182e22a278f23db2 03-Jun-2015 John Spurlock <jspurlock@google.com> Zen: Mute alarm (vibrations) in total silence.

Bug: 21376328
Change-Id: I00b46e64a0ec8d9b5066b5a9be10fc859dca0126
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
98d235bcba9cf26351457b336c2e874ee70ace2f 28-May-2015 Chris Wren <cwren@android.com> add time-in-mode metrics for zen mode

Emit log whenever the mode changes, or periodically to catch devices that stay
in one mode for long stretches of time.

Bug: 20264417
Change-Id: I4efde180eef23c2afc34c6c2e78ef4d0b6c5b675
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
995a749f278b45a2931b2846a60a8231dfd755b4 29-May-2015 John Spurlock <jspurlock@google.com> Zen: Use account name instead of calendar id in event conditions.

- Migrate the existing calendar attribute in the event condition
from a long calendar id to the calendar account name. More
portable across a backup/restore.
- Also skip restoring transient state (like the current condition
state) from restored automatic rules.

Bug: 17755700
Change-Id: I9bdb421d2209e3ce90873008665c254d67c788d2
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
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/ZenModeHelper.java
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/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.java
05715ecd4c31faaf7167851dc32cb6360202e97a 13-May-2015 John Spurlock <jspurlock@google.com> Zen: Map external ringer mode = silent to zen = alarms.

Bug: 21109517
Change-Id: I0e9506dad05ce4edf709ee879367b9f6aeba8dfd
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
50ced3f3231a26ddcafbc84600d7cf3f5a2a40d5 11-May-2015 John Spurlock <jspurlock@google.com> Zen: Ringer mode integration fixes.

- Properly mute media + alarm streams in total silence.
- Allow system components to update the "ringer mode affected"
streams dynamically.
- Improve dumpsys output for ringer mode streams (include names).
- Remember last ringer mode properly when entering dnd via a
volume down (so we can restore it properly when exiting).

Bug: 20854925
Bug: 20950463
Bug: 20756527
Change-Id: I80afc1f639ff802c541020e25ade1b23e9997ef9
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
4755cb3e5d8012b5554369d0df25ba8634267aa2 09-May-2015 John Spurlock <jspurlock@google.com> Merge "Zen: Tweak default automatic rules." into mnc-dev
cb9aa20bddbeebc3a052e40ca3b7d0a511fa8358 08-May-2015 John Spurlock <jspurlock@google.com> Zen: Tweak default automatic rules.

- Add a new default rule for calendar events.
- Rename all default rules to singular form. i.e. Weekend/Weeknight/Event

Bug: 20064962
Change-Id: Iee13238e0479fd2a05abdef4a5584455dcdd0c53
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
a492d1d88c3fd2bdddb046bc4278553a776bb8bf 06-May-2015 John Spurlock <jspurlock@google.com> Zen: Maintain source filters for both calls and messages.

Bug: 18635172
Change-Id: Ifeb56f1c8d8a30c4966c628edf7512199f3edb22
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
d9c75dba75ad4742dbaadc34db99d2b76cebca91 28-Apr-2015 John Spurlock <jspurlock@google.com> Volume: Simple dialog footer, DND in quick settings.

- Show DND tile by default, this is now the only
place to manage DND modes / end conditions.
- Remove super footer from volume dialog, replace with
a simplified version that displays the current mode
and allows ending DND.
- Remove obsolete text-only footer from codebase.
- Migrate remaining volume items into main resource files.
- Rename "No interruptions" to "Total silence".
- Add new user information banner for "Total silence"
- Crude media filtering for Total Silence.
(deeper muting changes will be done as a followup)
- Disable volume dialog sliders completely if muted due
to zen.
- Cleanup ZenModePanel: assume embedded mode, remove
expandable subhead
- Remember "favorite" DND mode inside the DND config panel.
- AudioService: consult ringer-mode-delegate before voluming
down into silent.
- Add new hour options to time-based exit conditions.
- Volume dialog visual updates to move closer to final visuals.
- Unify ringer=silent with DND.

Bug: 19260237
Change-Id: I05d7e001eca3b5125418ec3bc4087d0cb8866717
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
b02c744f05b0cca05b77fcbaad4a546ad86081eb 14-Apr-2015 John Spurlock <jspurlock@google.com> Zen: Enter alarms only on volume down from vibrate.

And vice versa (when dialog is showing).

Also make alarms only the default mode when DND is switched on
via the switch.

Bug: 19260237
Change-Id: I16e4a27944bc8245bb2beed84c0421d493b0b876
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
39581cc16d3c44acc8f0881d8e63afe53acaa1c1 10-Apr-2015 John Spurlock <jspurlock@google.com> Zen: Support external condition providers.

- Manage provider subscriptions for external condition providers
within ZenModeConditions.
- Move "is automatic rule active" check into common location.
- Add constant for external rule setting configuration page.
- Consolidate log tags.
- Reset rule snoozing on boot.

Bug: 20064962
Change-Id: Ida207dbf363f61e1727974e611f43f27c23accfb
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
1d7d2248ec1f8d8f752bf002b503e3b81042a398 10-Apr-2015 John Spurlock <jspurlock@google.com> Zen: New option to allow repeat callers.

Bug: 20064962
Change-Id: I11a5519c02bf8fa8e332559092c865c5e612fbd2
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
fc746f8ac5ea74747a502d4a75161a46f9cb892d 03-Apr-2015 John Spurlock <jspurlock@google.com> Zen: Changes to support new priority settings.

Bug: 20064962
Change-Id: Iac3444c0a55830d5e5459e26c2172d974db600d6
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
4f1163c83e79da52b2be7ff6b10163441895bc26 02-Apr-2015 John Spurlock <jspurlock@google.com> Zen: Add a new level: alarms-only.

Like no-interruptions, but allows alarms.

Bug: 19260237
Change-Id: I36bf0a333362256c8e54cd83992cb46c3bcb7f69
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
a48d779dad4c48aa2f97ad021ae3a5649c058312 03-Mar-2015 John Spurlock <jspurlock@google.com> Volume policy updates.

- Make volume policy settable by the volume UI instead
of hardcoded in AudioService.
- Add status bar icon for silent mode.
- Limit unmute-on-volume-adjust behavior to tvs.
- Ensure all changes to device volume are sent through
setIndex so no change events are missed.

Bug: 19260237
Change-Id: Iea070a7a6f90ff620e39629f2da3f33f87223d72
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
29b7872bf454d61f849d32d4a7a50485aa9c282d 11-Dec-2014 John Spurlock <jspurlock@google.com> Zen: Leave zen=none on manual ringer mode stream volume changes.

If the stream volume is changed from the api, leave zen=none
so as not to leave the system in an unexpected state.

Bug: 18084981
Change-Id: I857b3ff87ad4e2aa9aab479529caf13b819f854c
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.java
e5b42d97f6fd3eb0220ea84f21e60d530d93fc46 15-Oct-2014 John Spurlock <jspurlock@google.com> Leave zen when apps set ringer-mode = non-silent (normal/vibrate).

Apps can end up in priority mode by setting ringer-mode = silent.

Now they can leave priority mode by setting ringer-mode = non-silent.
(normal or vibrate)

Bug: 17884168
Change-Id: I54c853885f4ae9ee618041dd7ac6ab0663fc7b37
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
c909e1b2dfa2e47b786d96818f70f6308c5a78be 01-Oct-2014 John Spurlock <jspurlock@google.com> Zen: Fix new event category check.

Allow events through if configured, and use a switch
for separating mode-specific logic.

Bug:17580878
Change-Id: Id7b5d8b50173015d6a78568ed0a90e0bccf98549
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
2dac62c2e985ce1848b0fff751d4ed2cc3885c0c 19-Sep-2014 John Spurlock <jspurlock@google.com> Zen: Add events as a new config attribute.

Decouple events from alarms in the zen interception function,
and default the new allowEvents to true.

Bug:17580878
Change-Id: Iff10df385206ad73c3423ff118c79e94a10918d9
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
ef9f6f957d897ea0ed82114185b8fa3fefd4917b 13-Sep-2014 Tyler Gunn <tgunn@google.com> Renaming Telecomm to Telecom.

- Changing package from android.telecomm to android.telecom
- Changing package from com.android.telecomm to
com.android.server.telecomm.
- Renaming TelecommManager to TelecomManager.

Bug: 17364651
Change-Id: I192cb5d189f55db012ea72ee82ccc5aedbc21638
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
806dbae9e12f3875cf0def3da2f3c3c2b768a844 09-Sep-2014 John Spurlock <jspurlock@google.com> Zen: Map transition to ringer-mode silent to "priority".

Instead of "none".

Bug:16875664
Change-Id: I2a425663f08f35854e7e857330afc20eef01ef2e
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
1564b6d8d729eda405975828847841ba35a95735 08-Sep-2014 John Spurlock <jspurlock@google.com> Zen: Remove suppression of untagged vibrations in zen mode.

Bug:17313184
Change-Id: I07d24a7d9ce15160a4990391c53d7d6309a13c3e
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
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/ZenModeHelper.java
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/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.java
528dcd2fbe6556ca542a432b7aa26731663e3148 15-Aug-2014 John Spurlock <jspurlock@google.com> Zen: tweak audience interruption logic.

Only check audience for calls & messages.

Bug:17061146
Change-Id: I7f0176a7184c725fef393784fe8ccb0eb7f49ff7
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
5c8ea2c369deab75719fe7c7301846a8ef955702 08-Aug-2014 John Spurlock <jspurlock@google.com> Merge "New api to sync zen mode state from listeners." into lmp-dev
6ac5f8df62a4b6d87cf32797d2886efab8e28226 18-Jul-2014 John Spurlock <jspurlock@google.com> Allow user-prioritized packages through in priority mode.

Bug:16396715
Change-Id: I115d717e5c25500407d4f7876f070a1497fb2887
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.java
8c01d88208e17af01268ea01a08c46c2d2f96721 28-Jul-2014 John Spurlock <jspurlock@google.com> Zen: follow independent ringer mode changes.

Bug:16624498
Change-Id: Ib623118970a82c8406c714687b1b516378fe7824
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
b5e767b50918f70ba5f3420a58cc2631eacab903 27-Jul-2014 John Spurlock <jspurlock@google.com> Handle special users in default app check.

Change-Id: I3d1828f143a677bf48cc3caeff125196b6d315e3
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
c54459fb9469b60d85bff716c5f53c55ba0fc784 27-Jul-2014 John Spurlock <jspurlock@google.com> Zen: Remove hardcoded package name filters.

Bug:15474885
Change-Id: I282cc3d597b2a8855bcb4e987a11cea04f956bad
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
333f8dd78f8926dfb8851dbb23333c9f5553e69f 23-Jul-2014 John Spurlock <jspurlock@google.com> Wire up CATEGORY_ALARM and CATEGORY_EVENT.

And remove the alarm package whitelist now that deskclock
uses a category.

Bug:16406214
Change-Id: I6ca400376a9df7646889e394e53e4d491c56a46c
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
89c3b29a9bfa0ae9858b913bc1ab6604c4613a15 20-Jul-2014 Jean-Michel Trivi <jmtrivi@google.com> Rename USAGE_NOTIFICATION_TELEPHONY_RINGTONE

AudioAttributes: rename USAGE_NOTIFICATION_TELEPHONY_RINGTONE to
USAGE_NOTIFICATION_RINGTONE in the list of usage values.
Temporarily keep the old definition to prevent transient build
breakages, will be removed after telephony packages have been
updated.

Bug 16401631

Change-Id: I9398443fd7ba3c30e9d371c5c5a2934b9ea6f30a
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
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/ZenModeHelper.java
312d1d01def474e39e4dabbf4aef0b8adaa7caed 08-Jul-2014 John Spurlock <jspurlock@google.com> Zen: Use default phone app api in call filter.

Remove hardcoded list of packages (for calls).

Use the TelecommManager version until the PhoneManager version
is ready.

Change-Id: I4488f4ea3f0c03f009c84f519eb533e0ea1e07d5
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.java
3332ba54ae85df14d761447d86d2aa19d448ce11 10-Mar-2014 John Spurlock <jspurlock@google.com> Heads-up notifications for low battery warnings.

Falls back to dialogs when heads-up are N/A.

Add new ongoing notification if battery saver mode
is active. Offer to start battery saver on warnings,
if not already started.

True up BatteryMeterView's levels to the latest threshold
levels. 15% for first warning.

Bug:13329308
Change-Id: Id8ad11a1997079ee7165ae003a8fa1c744462ab3
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.java
99f963ea04d7a86219ece00c356f3f6bce33b6d6 28-May-2014 Chris Wren <cwren@android.com> Add people signals to Zen mode.

Depends-On: I51fcf689ddbee7715e3387b865f18a715887c943
Change-Id: I7c91dec1afeb54505426c4da59ec4d072a60c240
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.java
e86de4c0670550a29edae77ebb9f5c8ba5631231 30-Apr-2014 John Spurlock <jspurlock@google.com> Zen mode tweaks.

- Fix regression with alarms.
- Run all condition provider callbacks on the main thread.
- Exit zen mode if the current condition is disabled / uninstalled.

Bug:14402762
Change-Id: I0746670c1910047a9dc9b7e29aa1a6c3899fd9fe
/frameworks/base/services/core/java/com/android/server/notification/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.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/ZenModeHelper.java