summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/NotificationManagerService.java
Commit message (Collapse)AuthorAgeFilesLines
* DO NOT MERGE: Maintain binding to crashed listeners.Dan Sandler2014-03-171-13/+24
| | | | | | | | | | | | Adapted from change I44ce250e, "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: I41d0c6733046ee9760bcfae4407e754592b805ea
* Implement new SYSTEM_UI_FLAG_IMMERSIVE_STICKY.John Spurlock2013-10-141-5/+3
| | | | | | | | | | | | | | | | | | | | Migrate transient bar mode to IMMERSIVE_STICKY, and introduce new behavior for IMMERSIVE: namely the opaque bars are revealed by clearing the flags on swipe. Remove low-profile optimization that confuses api demos and other apps using low-profile as a signal. TransientNavigationConfirmation renamed to ImmersiveModeConfirmation, and its associated resources, since the confirmation is now shown when the nav bar is shown in either of the two immersive modes. Remove unused Toast.makeBar and associated hidden framework bits now that the confirmation uses a cling instead. Bug:11062108 Change-Id: Iae49d31973940b9bee9f5b1827756db5eaa76aa3
* Don't crash when component enable/disable broadcasts race with uninstallChristopher Tate2013-10-091-5/+13
| | | | | | Bug 11154482 Change-Id: I55107fec51bf5efada136052c451f293976360d6
* Polish the print spooler loading of stored print jobs.Svetoslav Ganov2013-08-041-18/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | 1. The singleton print spooler isntance is created when the print spooler service gets a connection to the system and is destroyed when this connection is removed. Note that if the spooler has work, then the connection to the system will not be removed. When the spooler is created, it reads the stored state and notifies the system which in turn dispatches this to the print services. When the system connects to the spooler and passes it a connection, we schedule a delayed check whether there is work for the spooler. We do not handle this immediately to avoid intermitted spinning on and off of the spooler process if a client makes a sequence of queries while the spooler has really no work. 2. Fixed a bug in the NotificationManagerService where adding a notification and removing it immediately after that does not remove the notification. The code that is adding a notification is run on a handler thread while the code to remove it on the calling thread. This creates a race and erroneous results. Now the removal is also scheduled on the handler. 3. Many small fixes here and there. Change-Id: I6415c253139fa6616393fbe23c659d031a29e1f6
* am 9e6f26a8: am f3e2f8fe: am 9eb434c3: Allow the user to block notifications ↵Daniel Sandler2013-08-011-4/+8
|\ | | | | | | | | | | | | for foreground services. * commit '9e6f26a8e1e69b1c49676d60a5ebe36c0a0f23f9': Allow the user to block notifications for foreground services.
| * Allow the user to block notifications for foreground services.Daniel Sandler2013-08-011-4/+8
| | | | | | | | | | | | | | | | | | | | Stepping carefully around the fix in change Idc788527, we perform security (and AppOps, and therefore user block) checks against the uid passed to enqueueNotificationInternal rather than the Binder caller. Bug: 9502541 Change-Id: I91745db92823381df75721c1b8f11013a7fa4ecc
* | Notification muting conditional to exclusive audio focus requestJean-Michel Trivi2013-07-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary of feature: Do not mute notifications when speech recognition recording is active, but when an app has requested audio focus with AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE. Implementation: Move definition of AUDIOFOCUS_NONE to AudioManager where other audio focus codes are defined. Add support for querying the current audio focus type. When audio focus is requested as GAIN_TRANSIENT_EXCLUSIVE, make the corresponding loss by LOSS_TRANSIENT. Before playing a notification, check whether GAIN_TRANSIENT_EXCLUSIVE has been requested. Bug 8251963 Change-Id: I41edc77326b70639d2fdcb4642c53109995b72a8
* | Add support for notification scorers.Scott Greenwald2013-07-231-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds an interface and classes for scoring notifications. The NotificationManagerService initializes an array of scorers specified as a resource. When a Notification is enqueued, the getScore() method is called successively on the scorers, each getting the Notification to be scored, and the score outputted by the previous scorer. At present there is a single scorer which prioritizes Notifications that mention the display name of a starred contact. To turn off the StarredContactNotificationScorer: adb shell settings put global contact_scorer_enabled 0 Change-Id: Ic16c80952e7c85bdde292ebb3f7900efb01f2e29
* | move scoring, sound, vibration, and lights into a handlerScott Greenwald2013-06-271-210/+235
| | | | | | | | | | | | | | | | | | | | | | As a prelude to introducing fancier scoring functions, this CL moves scoring and everything that depends on it into a handler. This allows the NotificationManagerService to report back to the calling process right away about whether or not the notification is valid; not blocking while score is computed, and non-statusbar notification modalities are activated. Change-Id: Iaf77bc89544bb7bcb7adeda60885d74c3170541c
* | am 5be52fb5: am a0c9b9d2: Merge "Temporarily restore some support for ↵Daniel Sandler2013-06-141-2/+4
|\ \ | |/ | | | | | | | | | | icon==0 notifications." into jb-mr2-dev * commit '5be52fb5ae462b83b0619b95e7991e52bc2031b2': Temporarily restore some support for icon==0 notifications.
| * Merge "Temporarily restore some support for icon==0 notifications." into ↵Daniel Sandler2013-06-141-2/+4
| |\ | | | | | | | | | jb-mr2-dev
| | * Temporarily restore some support for icon==0 notifications.Daniel Sandler2013-05-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is WRONG WRONG WRONG but certain apps rely on it to poke the LED and so forth. In a future release this will stop working. Bug: 8623399 Change-Id: I49bb8ccc6891b1398ceec94c64d6c3a510ad1c38
* | | am 0a2ff8db: am 4e5694aa: Merge "Do not block notifications or toasts for ↵Daniel Sandler2013-06-111-7/+14
|\ \ \ | |/ / | | | | | | | | | | | | | | | SYSTEM_UID or PHONE_UID." into jb-mr2-dev * commit '0a2ff8db4339261d701ad542ac770fb92bf2127b': Do not block notifications or toasts for SYSTEM_UID or PHONE_UID.
| * | Do not block notifications or toasts for SYSTEM_UID or PHONE_UID.Daniel Sandler2013-06-101-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The specific bug is this: SIM PIN unlock attempt toasts are sent from com.android.settings/.IccLockSettings which runs as the phone process; NoMan wasn't having any of that and was blocking the toasts. With this change we treat SYSTEM_UID and PHONE_UID the same for all security checks, and furthermore we guarantee that all notifications and toasts from those UIDs will be permitted. Bug: 9098802 Change-Id: Idc788527aa2cb38e015fe92773766a514167999e
* | | Hideybars feature confirmation toast bar.John Spurlock2013-05-281-5/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enhance Toast to support new standard toast bar style, similar to the undo bar in Gmail. Toast bars can be interactive, and can have a single action. Add a new toast duration to indicate persistent toasts (no auto-hide delay). Use the new toast bar to implement a feature hint when hiding the navigation bar in hideybars mode. Per UX, the feature confirmation bar can also be dismissed on any outside touch as long as the user confirmed it using the OK button at least once globally. Bug: 8754108 Change-Id: Iaa85d3b4da7ada1952a562f1e31de04380f5d587
* | Merge "Compare binder instances when checking if listeners match." into ↵Andrew Wilson2013-05-231-1/+2
|\ \ | | | | | | | | | jb-mr2-dev
| * | Compare binder instances when checking if listeners match.Andrew Wilson2013-05-221-1/+2
| | | | | | | | | | | | | | | Bug: 9069919 Change-Id: I06130105cb703de35de76ab2fceba3855fa5407a
* | | Merge "Archive a copy of each dismissed notification." into jb-mr2-devDaniel Sandler2013-05-211-4/+5
|\ \ \ | |/ / |/| |
| * | Archive a copy of each dismissed notification.Daniel Sandler2013-05-211-4/+5
| |/ | | | | | | | | | | | | | | | | We don't want to save all the heavyweight stuff, but we can't lighten the notification in place because there may be other active references. Bug: 8839246 Change-Id: Id6dcc1cf5ae196ee3e42908d6b3ec4e928e9f0c5
* | Deactivate notification listeners disabled at runtime.John Spurlock2013-05-181-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | PACKAGE_CHANGED is called when either the application or any of its components change. Rework old early exit code to handle component-level disabling wrt listeners. Note PACKAGE_CHANGED can take quite a while to reach NMS. Up to ten seconds (!) after component-disabling in app. Bug:8982243 Change-Id: Ia325516140dd9288466a663192a5326019f071ab
* | disable notification listeners on uninstallChris Wren2013-05-171-1/+67
|/ | | | | Bug: 8979640 Change-Id: I9f1d118e5ce210b829476e0971f3d55fc778c227
* Rebind notification listeners for current user.John Spurlock2013-05-161-3/+4
| | | | | | | Use ForUser overload when reading setting inside system server. Bug: 9000206 Change-Id: Ie87aed578d29425d8f32b23aeb8aa7118922c889
* restart notification listener on package addChris Wren2013-05-101-1/+3
| | | | | Bug: 8813471 Change-Id: Icf6c69811392c4567a5c842740e463fb957e7563
* Defend against a system server crash.Daniel Sandler2013-05-071-1/+7
| | | | | Bug: 8575629 Change-Id: Iafc8ab2f7460c8eacc37fc077cf5a3df16cf2911
* API: getPkg() -> getPackageName()Daniel Sandler2013-04-251-7/+7
| | | | | Bug: 8656860 Change-Id: If3062b9fc00270e5f0ecfe67e593b9a28c6bccdd
* API cleanup: NotificationListenerDaniel Sandler2013-04-251-24/+23
| | | | | | | | | | - Wrap all public member variables in getters and make slots private - Rename clear* methods to cancel* to be more consistent with existing public Notification API Bug: 8656860 Change-Id: I84f7e71fbb627f859352a93089c6a531b44dac95
* New NotificationListener API: getActiveNotifications()Daniel Sandler2013-04-241-0/+24
| | | | | | | | | This allows a listener service to catch up on the current state of the notification panel at any time, including at startup. Bug: 8656860 Change-Id: I1a3d665d84576e17870929a63dda334afc696010
* Merge "Fix concurrency issues when parceling StatusBarNotifications." into ↵Daniel Sandler2013-04-231-13/+10
|\ | | | | | | jb-mr2-dev
| * Fix concurrency issues when parceling StatusBarNotifications.Daniel Sandler2013-04-221-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Protip: Don't mess with Bundles after you've sent them off for parceling in an RPC. Note that this change reduces the payload size of StatusBarNotification objects received in onNotificationRemoved() callbacks; it scrubs out the RemoteViews and Bitmaps just as the NoMan's internal archive does. [You don't really need that information anyway when hearing about a removed notification; most likely all you need are the other slots on StatusBarNotification, but nulling the whole Notification object breaks a lot of clients.] Bug: 8616295 Change-Id: Ic899045f2352b96dcf064d3e9e51dad52629aea3
* | Once again, cancel all when notifications canceled for pkg.Daniel Sandler2013-04-181-3/+8
|/ | | | | | | | | | | | Right now this only works if you go through the front door (using setNotificationsEnabledForPackage()); if you set the AppOps for a package otherwise the existing notifications will not be cleared (but new ones will be blocked). Since there's no UI for modifying AppOps today this shouldn't be a problem. Bug: 8489214 Change-Id: I84f8c76a0d03959127e9076ab2b7d37dbdaebb17
* Treat the default sound Uri the same as DEFAULT_SOUND.Daniel Sandler2013-04-171-1/+5
| | | | | | | | | | | | | For the purposes of deciding whether or not to invoke the "fallback vibrate", that is. (RingtonePicker will return content://settings/system/notification_sound when "Default" is chosen, so if the app pops this Uri directly into Notification.sound, we should treat it like DEFAULT_SOUND and look to see whether the system notification sound is not None before running the fallback vibration.) Bug: 8627641 Change-Id: Ia469b8e4d5d7647ce1a8a179f591ed7a3443b5c5
* Further reduce memory usage of notification archive.Daniel Sandler2013-04-161-1/+28
| | | | | | | | | | - Max 250 notifications preserved (was 1000) - Known heavyweight extras are removed - print some of 'em out in dumpstate, while we're at it Bug: 8280039 Bug: 8537938 Change-Id: I9239128c32a1d9f5ef4e0dc62dc2d23e190871e9
* Finish annotating Notification.extras.Daniel Sandler2013-04-151-10/+51
| | | | | | | | | | | This covers all useful data from the basic Builder as well as each of the Styles that is not otherwise captured on the Notification object itself. Extras are now prettyprinted in dump() output. Bug: 8270485 Change-Id: I47fc50860dab6409793f57e904cc60296310d5cf
* New NotificationListenerService.Daniel Sandler2013-04-051-54/+314
| | | | | | | | | | | | | | | | | | | | | This is the best and only way for apps to listen for notifications: create a NotificationListenerService, wait for the NoMan to bind to you (as a result of the user checking a box somewhere in Settings and agreeing to a scary dialog box), and you'll start receiving notification posted and dismissed callbacks. Your service, while enabled, will also be able to clear one or all notifications. Use this power wisely. This change moves StatusBarNotification out of com.android.internal into android.service.notification. [Internal customers, including System UI and early users of the system-only listener binder API, will need to be updated.] Bug: 8199624 Change-Id: I1be46f823d4b3ddc901109ec1e085cd6deb740c2
* Nuke heavy parts of notification before archiving.Jeff Sharkey2013-04-031-1/+7
| | | | | Bug: 8537938 Change-Id: I2e4eccc3bd6d57fe5cef340d9e67986d78d3be95
* Allow whitelisted non-system packages to listen for notifications.Daniel Sandler2013-03-211-24/+105
| | | | | | | | | The allowed packages are listed in Settings.Secure.ENABLED_NOTIFICATION_LISTENERS. (Don't let the plural fool you: only one listener will be supported in the UI.) Change-Id: Ia69f2ba05d8e555fd4d40b0cc89c62ed14af3cac
* Accumulate updates to notifications before archiving.Daniel Sandler2013-03-071-3/+3
| | | | | | | | | | By only adding notifications to the archive when they are removed we batch up multiple updates and only store the final version. Some data is lost in this process, but we save tons of memory storing otherwise redundant / uninteresting data (e.g. each step of a download). Change-Id: I008afefc1242bb7c433d45da2c36fcc626dd3706
* Properly support USER_ALL in notification listener API.Daniel Sandler2013-03-071-2/+8
| | | | | | | | | Listeners should be notified for any notification if they register for USER_ALL, or for any notification posted to USER_ALL. Bug: 8328357 Change-Id: Ib5024d41287090d1a390539a015d8cb4dfa854a7
* New INotificationListener interface.Daniel Sandler2013-02-191-0/+91
| | | | | | | Use with INotificationManager.registerListener(). Limited to system only right now. Change-Id: I65b6a8778267022cdc5e58eb75ae607a54b1cc52
* Historical notification access API.Daniel Sandler2013-02-121-2/+42
| | | | | | | | | | | | Similar to getActiveNotifications(), getHistoricalNotifications() returns a list of all notifications that have been posted, in reverse-chronological order. It currently includes duplicate entries for notifications that have been updated (so it really is tracking every notification that has been posted to the system). Change-Id: Icce8d6f96bbe76710c989fd0068ff971c6498605
* New API to request a list of current notifications.Daniel Sandler2013-02-071-69/+145
| | | | | | The ACCESS_NOTIFICATIONS permission is signature|system only. Change-Id: I41338230aee9611117cbdac251c1b6b6c3cebf00
* App ops: vibration, neighboring cells, dialing, etc.Dianne Hackborn2013-02-011-10/+13
| | | | | | | | | | | | | | | | | Improve handling of vibration op, so that apps are better blamed (there is now a hidden vibrator API that supplies the app to blame, and the system now uses this when vibrating on behalf of an app). Add operation for retrieving neighboring cell information. Add a new op for calling a phone number. This required plumbing information about the launching package name through the activity manager, which required changing the internal startActivity class, which required hitting a ton of code that uses those internal APIs. Change-Id: I3f8015634fdb296558f07fe654fb8d53e5c94d07
* Migrate package notification restrictions to AppOps.Daniel Sandler2013-02-011-75/+59
| | | | Change-Id: I23064ce3014d2446d009bbdff92b301280e8b989
* am 8f7eddbe: am 652d8fc9: Merge "PRIORITY_MIN notifications should be truly ↵Sascha Prueter2012-12-041-2/+13
|\ | | | | | | | | | | | | ambient." into jb-mr1.1-dev * commit '8f7eddbef33f97e7d4439707ac0039be4c81ef0e': PRIORITY_MIN notifications should be truly ambient.
| * PRIORITY_MIN notifications should be truly ambient.Daniel Sandler2012-12-041-2/+13
| | | | | | | | | | | | | | | | | | | | If your notification is set to MIN priority, it will never attempt to interrupt the user, either by an icon (already implemented), or (new in this patch) by LED, vibration, or sound. Bug: 7648785 Change-Id: Ia0f8e010e62029d8d8ef1955dd20b7c79fb68398
* | am 8fef4a82: am 15db00eb: Merge "DEFAULT_VIBRATE must always use the default ↵Daniel Sandler2012-11-201-4/+4
|\ \ | |/ | | | | | | | | | | vibe pattern" into jb-mr1.1-dev * commit '8fef4a820ee217f25fbf29234e90d68dff448222': DEFAULT_VIBRATE must always use the default vibe pattern
| * DEFAULT_VIBRATE must always use the default vibe patternDaniel Sandler2012-11-201-4/+4
| | | | | | | | | | | | | | | | | | | | The logic here was backwards, causing the (softer) fallback vibe pattern to be applied if the notification specified a sound (or DEFAULT_SOUND) and also DEFAULT_VIBRATE. The fallback vibe should only play if you have *no* vibration set. Bug: 7588655 Change-Id: Iecdd362729bccedf779b51cc9b90a12014328aff
* | am 00679b5b: am 020d6529: Merge "Do not vibe when the default notification ↵Daniel Sandler2012-11-151-9/+20
|\ \ | |/ | | | | | | | | | | sound is Silent." into jb-mr1.1-dev * commit '00679b5b467dbc19ce2223b5501976c5c3f66fa9': Do not vibe when the default notification sound is Silent.
| * Do not vibe when the default notification sound is Silent.Daniel Sandler2012-11-141-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | (This relates to the new vibration fallback behavior, where notifications that expect to make a sound should always vibrate in vibrate mode. We should not vibrate if the notification's sound is silent, but we should also not vibrate if the notification uses the default sound and the default is silent.) Bug: 7537077 Change-Id: I08e149c8c00ef2d2f61e418d88a086cb5e9cf241
* | am 2bb5dc6a: am 83b25961: Merge "Notification vibration improvements:" into ↵Daniel Sandler2012-11-151-8/+51
|\ \ | |/ | | | | | | | | | | jb-mr1.1-dev * commit '2bb5dc6a367ce869939728b2978be7ca61a4b8b8': Notification vibration improvements: