summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/WallpaperManagerService.java
AgeCommit message (Collapse)Author
2013-11-12Move some system services to their own sub package.Amith Yamasani
As a next step they can be moved into separate directories to be built as separate modules that may or may not be included in a particular configuration. Moves AppWidgetService, BackupManagerService, ClipboardService, DevicePolicyMS, and WallpaperMS. Change-Id: I33e48d070f38186819d3a1d7a4dc3984b75a9eda
2013-11-05am 194ff90c: am 802e04c1: am a89727c8: Merge "Ensure wallpaper hint is at ↵John Spurlock
least the display\'s max size." into klp-dev * commit '194ff90c2b8c1271cf21d9183c5da78757b4416c': Ensure wallpaper hint is at least the display's max size.
2013-11-04Ensure wallpaper hint is at least the display's max size.John Spurlock
Bug:11332853 Change-Id: Ied13ffab77395f64642f7fb536f36d9cd8367e74
2013-10-04Merge "Change WallpaperManagerService TAG to match class name"Michael Wright
2013-10-03Ensure WallpaperEngine has correct size informationMichael Wright
Currently it's possible for the WallpaperManagerService to receive a request to change the desired wallpaper size between when it attaches to the WallpaperService and when the Engine attaches back to it. This means that the Engine will be created with the prior dimensions and won't receive the update. Check to see if we're in this state and make note to update the Engine once it attaches to ensure that the Engine always has the correct dimensions. Bug: 10853302 Change-Id: I8d5cd3371b269dbb4c0ff2d75c68529b69028ae5
2013-10-02Change WallpaperManagerService TAG to match class nameMichael Wright
Previous TAG was "WallpaperService", which conflicted with the WallpaperService class' tag, making debugging wallpaper issues more confusing than necessary. Change-Id: I0f60ff472304a1d8792d9941ddab7ce0304a2276
2013-09-08Don't crash attempting restore of uninstalled live wallpaperChristopher Tate
Bug 10658041 Change-Id: I08b38cc81fbb89907a4ffe5b6f94e9a507226011
2013-07-16Merge "Refactoring of the print sub-system and API clean up."Svetoslav Ganov
2013-07-16Refactoring of the print sub-system and API clean up.Svetoslav Ganov
1. Now a user state has ins own spooler since the spooler app is running per user. The user state registers an observer for the state of the spooler to get information needed to orchestrate unbinding from print serivces that have no work and eventually unbinding from the spooler when all no service has any work. 2. Abstracted a remote print service from the perspective of the system in a class that is transparently managing binding and unbinding to the remote instance. 3. Abstracted the remote print spooler to transparently manage binding and unbinding to the remote instance when there is work and when there is no work, respectively. 4. Cleaned up the print document adapter (ex-PrintAdapter) APIs to enable implementing the all callbacks on a thread of choice. If the document is really small, using the main thread makes sense. Now if an app that does not need the UI state to layout the printed content, it can schedule all the work for allocating resources, laying out, writing, and releasing resources on a dedicated thread. 5. Added info class for the printed document that is now propagated the the print services. A print service gets an instance of a new document class that encapsulates the document info and a method to access the document's data. 6. Added APIs for describing the type of a document to the new document info class. This allows a print service to do smarts based on the doc type. For now we have only photo and document types. 7. Renamed the systemReady method for system services that implement it with different semantics to systemRunning. Such methods assume the the service can run third-party code which is not the same as systemReady. 8. Cleaned up the print job configuration activity. 9. Sigh... code clean up here and there. Factoring out classes to improve readability. Change-Id: I637ba28412793166cbf519273fdf022241159a92
2013-07-15Switch proc stats to use new process state constants.Dianne Hackborn
These new constants are a better mapping to the kind of information that procstats is wanting to collect about processes. In doing this, the process states are tweaked to have a bit more information that we care about for procstats. This changes the format of the data printed by procstats, so the checkin version is bumped to 2. The structure is the same, however the codes for process states have all changed. The new codes are, in order of precedence: p -- persistent system process. t -- top activity; actually any visible activity. f -- important foreground process (ime, wallpaper, etc). b -- important background process u -- performing backup operation. w -- heavy-weight process (currently not used). s -- background process running a service. r -- process running a receiver. h -- process hosting home/launcher app when not on top. l -- process hosting the last app the user was in. a -- cached process hosting a previous activity. c -- cached process hosting a client activity. e -- cached process that is empty. In addition, we are now collecting uss along with pss data for each process, so the pss checkin entries now have three new values at the end of the min/avg/max uss values of that process. With this switch to using process state constants more fundamentally, I realized that they could actually be used by the core oom adj code to make it a lot cleaner. So that change has been made, that code has changed quite radically, and lost a lot of its secondary states and flags that it used to use in its computation, now relying on primarily the oom_adj and proc state values for the process. This also cleaned up a few problems -- for example for purposes of determing the memory level of the device, if a long-running service dropped into the cached oom_adj level, it would start being counted as a cached process and thus make us think that the memory state is better than it is. Now we do this based on the proc state, which always stays as a service regardless of what is happening like this, giving as a more consistent view of the memory state of the device. Making proc state a more fundamentally part of the oom adj computation means that the values can also be more carefully tuned in semantic meaning so the value assigned to a process doesn't tend to change unless the semantics of the process has really significantly changed. For example, a process will be assigned the service state regardless of whether that services is executing operations in the foreground, running normally, or has been dropped to the lru list for pruning. The top state is used for everything related to activities visible to the user: when actually on top, visible but not on top, currently pausing, etc. There is a new Context.BIND_SHOWING_UI added for when system services bind to apps, to explicitly indicate that the app is showing UI for the system. This gives us a better metric to determine when it is showing UI, and thus when it needs to do a memory trim when it is no longer in that state. Without this, services could get in bad states of continually trimming. Finally, more HashSet containers have been changed to ArraySet, reducing the temporary iterators created for iterating over them. Change-Id: I1724113f42abe7862e8aecb6faae5a7620245e89
2013-01-16Rename bindService to bindServiceAsUser to follow convention.Amith Yamasani
This is for the multi-user version of bindService, not the original. Change-Id: Ib2de35941196accf387b1a276a77e6f9af805ec0
2012-11-28Cleaner initial boot.Dianne Hackborn
This does some cleanup of the initial boot, especially when booting in "no core apps" mode for encryption/decryption. Change-Id: Ifb3949f580e52f54559e603c4b0b104f6bac2f6c
2012-10-30Don't clean up wallpaper map entry when stopping a user.Amith Yamasani
Sometimes on quickly stopping and starting a user, a race condition causes the user entry to disappear, causing crashes in Launcher and SystemUI. Removing this step, since it doesn't really leave much residue behind. Bug: 7434849 Change-Id: Ia188602f1a79f75d307397459c2a03fadee4c722
2012-10-15Do cleanup when Stopping usersAmith Yamasani
Mark user 0 as initialized, otherwise it will show up as uninitialized when viewed from secondary user if never switched to user 0. Bug: 7301595 Also clean up any users that were in the process of being removed, if device crashes at a bad time. Change-Id: Ic16a6c9ccb6a64b7463725f6cc279335a821fcd5
2012-10-05Merge "Fix issue #7275122: Wall paper jank when switching users" into jb-mr1-devDianne Hackborn
2012-10-05Fix issue #7275122: Wall paper jank when switching usersDianne Hackborn
Change-Id: I2677c7641a01b4afe89db29cb5fc1af876f9d078
2012-10-04Fix dupes in initial wallpaper selectionAmith Yamasani
Bug: 7281217 Needed to load the settings for the user, in case the user was stopped. Change-Id: I52d1f59a7681f8c4f7d3596486accb91cb840ecf
2012-09-20Implement multi-user PackageMonitor.Dianne Hackborn
New APIs let you indicate what user(s) to monitor, and tell you what user is changing when receiving a callback. Fix package manager to only deliver package brpadcasts to the running users. (This isn't really a change in behavior, since the activity manager would not deliver to stopped users anyway). Make sure all broadcasts that package monitor receives also include user information for it to use. Update wallpaper service to (hopefully) now Really Correctly monitor package changes per user. Change-Id: Idd952dd274abcaeab452277d9160d1ae62919aa0
2012-09-15More multi-user stuff.Dianne Hackborn
- New public APIs to find out when a user goes to the foreground, background, and is first initializing. - New activity manager callback to be involved in the user switch process, allowing other services to let it know when it is safe to stop freezing the screen. - Wallpaper service now implements this to handle its user switch, telling the activity manager when it is done. (Currently this is only handling the old wallpaper going away, we need a little more work to correctly wait for the new wallpaper to get added.) - Lock screen now implements the callback to do its user switch. It also now locks itself when this happens, instead of relying on some other entity making sure it is locked. - Pre-boot broadcasts now go to all users. - WallpaperManager now has an API to find out if a named wallpaper is in use by any users. Change-Id: I27877aef1d82126c0a1428c3d1861619ee5f8653
2012-08-31Merge "Remove Binder.getOrigCallingUid()." into jb-mr1-devDianne Hackborn
2012-08-31Centralize the creation of the user system directoryAmith Yamasani
Environment.getUserSystemDirectory(int userId) Use it all relevant places that was hardcoding it. Also, wipe out the user's system directory when user is removed, otherwise old state might be transferred to a new user. Change-Id: I788ce9c4cf9624229e65efa7047bc0c019ccef0a
2012-08-31Remove Binder.getOrigCallingUid().Dianne Hackborn
Replaced all remaining places that used it with explicit user specification. While doing this, I ran into stuff that was creating PendingIntent objects (that now need to specify the explicit user they are for), which are also posting notifications... but have no way to specify the user for the notification. So the notification manager in the system process now also gets a formal concept of a user associated with the notification, which is passed in to all the necessary aidl calls. I also removed the old deprecated aidl interface for posting/cancelling notifications, since we now always need a user supplied. There is more work that needs to be done here, though. For example I think we need to be able to specify USER_ALL for a notification that should be shown to all users (such as low storage or low battery). Along with that, the PendingIntent creation needs to be tweaked to be able to handle USER_CURRENT by evaluating the user at the point the pending intent is sent. That's for another change, however. Change-Id: I468e14dce8def0e13e0870571e7c31ed32b6310c
2012-08-30Improve multi-user broadcasts.Dianne Hackborn
You can now use ALL and CURRENT when sending broadcasts, to specify where the broadcast goes. Sticky broadcasts are now correctly separated per user, and registered receivers are filtered based on the requested target user. New Context APIs for more kinds of sending broadcasts as users. Updating a bunch of system code that sends broadcasts to explicitly specify which user the broadcast goes to. Made a single version of the code for interpreting the requested target user ID that all entries to activity manager (start activity, send broadcast, start service) use. Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c
2012-08-28Fix adding live wallpaper in a second userAmith Yamasani
When the second user downloads a new wallpaper service, Wallpaper service needs to query the correct user's package state to figure out if it is available and bind to it. Change-Id: Ifb95db1c859887f996f5b2e821b4b46510ee7016
2012-08-18Fixed static wallpaper for multi-userAmith Yamasani
Earlier assumption that systemui was running in the system process does not hold true, so running static wallpaper in its own user sandbox. Bug: 7008230 Change-Id: I32a128e6bbd8efa7006286330e970bafcf37f05a
2012-08-17UserHandle to UserSerialNo mappingAmith Yamasani
Use AtomicFile for usermanager files. Added a MANAGE_USERS permission that apps (signature permission) can use to create/query/modify/remove users. Change-Id: I5cf232232d0539e7508df8ec9b216e29c2351cd9
2012-08-16am a2e8365c: am 9b0da58e: Merge "Introduce a restorecon JNI binding."Kenny Root
* commit 'a2e8365cc883de0d3e56e9f4af350ecfe1b8fc4c': Introduce a restorecon JNI binding.
2012-08-16Rename UserId to UserHandle.Dianne Hackborn
This is the start of turning this into a formal public API. Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
2012-07-25Introduce a restorecon JNI binding.rpcraig
Label the vmdl.*\.tmp files and the final .apk file differently. Modify the WallpaperManagerService to restorecon the wallpaper file. Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil> Change-Id: Idfc056e9ec0508d7e11100626a7114f341f1af70
2012-04-19Move handling of package changes to a background thread.Dianne Hackborn
Helps get rid of some jank when installing applications. Change-Id: I97d0022f82d67796e334d37086e5911dd6ca6b62
2012-03-27User management and switchingAmith Yamasani
Broadcast intents that get sent out when users are added/removed/switched. More work on generating user-specific information in package manager queries. APIs to update user name and query a user by id. Removed Package.mSetStopped and mSetEnabled, since they're not user specific. User removal: - Cleanup ActivityManager, PackageManager, WallpaperManager, AppWidgetService and AccountManager. - Shutdown processes belonging to the user. Don't show vibrate option in long-press power if there's no vibrator. Lock the screen when switching users, to force unlocking. Change-Id: Ib23a721cb75285eef5fd6ba8c7272462764038fa
2012-02-10Multi-user - wallpaper serviceAmith Yamasani
- Allow each user to have their own wallpaper (live or static). - Migrate old wallpaper on upgrade. - Update SystemBackupAgent to backup/restore from primary user's new wallpaper directory. Reduce dependency on Binder.getOrigCallingUser() by passing the userId for bindService. Change-Id: I19c8c3296d3d2efa7f28f951d4b84407489e2166
2011-11-29Fix issue #5628789: Cannot set static/custom wallpaper after clearing ↵Dianne Hackborn
Settings data Need to make sure the "files" directory is created. Change-Id: I8d5b374a5a03590a5ce7fafb5171705414f7b2f9
2011-10-21Fix issue #5342788: Setting wallpaper from gallery set default...Dianne Hackborn
...wallpaper first time IRK81. We were monitoring for file creates when those are not needed, and receiving the initial file create was causing us to be confused. Change-Id: Iccd3b7492c82895dba87f25c4881c538f300d342
2011-10-07Fix wallpaper restoreChristopher Tate
Following a restore of the wallpaper data files, the settingsRestored() method was binding the new wallpaper by passing null as the component, because once upon a time that meant just use the configuration that had just been loaded from the [newly restored] settings filed. However, at some point this broke when the load from settings was made a staging operation, not also the commitment of the changes. This CL passes the newly-determined component configuration explicitly to the bind, overriding the product default that may already have been emplaced by the time the restore happens. It also turns off the (minor) debugging that had been enabled in WallpaperBackupHelper while digging into the issue. Bug 5416839 Change-Id: I963893c236e24c75d10dde75836805295ea42cbb
2011-09-15Fix issue #5317970: Removing active wallpaper from manifest crashes phoneDianne Hackborn
Clean up a bunch of stuff about dealing with failures in applying the wallpaper. Change-Id: Ib0c7ec6cc00936dd00c752991be068dc75fc24c9
2011-08-24Merge "Fix to show the correct HW accel background in the preview window."Dianne Hackborn
2011-08-24Fix to show the correct HW accel background in the preview window.Dianne Hackborn
Also tweak wallpaper service to do a cleaner transition to a static wallpaper. Change-Id: I876a32091f92dd5a529d7fd809d3b8e730bb7d2a
2011-08-24Add OpenGL backend to ImageWallpaperRomain Guy
Bug #5204874 Currently disabled. Change-Id: I5e7b35dce2981b0691f107e39c6394b260466543
2011-08-05Fix issue #5108980 Wallpaper is not restored after upgrade from IRK32B to IRK33BDianne Hackborn
Take care of updating from old component name, and don't let this happen again. Also tweak how we switch between static wallpapers to avoid introducing a 4MB allocation in the system UI process when this happens -- we now stop the current wallpaper service and start a new one, so we get a brand new surface that we can draw only one time in to. Change-Id: I6fc8a42b8a46bba79759bd68fb7d0684b5d897b7
2011-08-01Move ImageWallpaper to SystemUI process.Dianne Hackborn
Nice to not load 4MB bitmaps in the system process. Also, hey, with how we are now scrolling the surface instead of the bitmap, there is no reason to keep that 4MB bitmap loaded in to memory. So don't. Unfortunately it looks like for some reason the VM is still holding on to the bitmap. I'll need to figure out why. Later. Change-Id: Ib3503756144502fc5c8d5e294248c2417c4fe8c8
2011-04-21Rework display size access.Dianne Hackborn
Applications now get the display size from the window manager. No behavior should be changed yet, this is just prep for some real changes. Change-Id: I2958a6660895c1cba2b670509600014e55ee9273
2011-02-17Start window manager refactoring.Dianne Hackborn
Move all of the pieces into a new com.android.server.wm package. Change-Id: I942b7bcfb84ee0f843f47d58e55ffc5a93c0da94
2010-12-23frameworks/base: Fix to release references to previous live wallpaperVairavan Srinivasan
The service connection to the previous live wallpaper is unbound when a new wallpaper is effective. Although the service connection is unbound it is not disconnected and its reference to wallpaper's service and engine is still effective. This adds up to the total JNI references and causes dalvik (hosting system_server) to abort. Fix is to release the references in clearWallpaperComponentLocked. Change-Id: Idd2bab83a56d2e6c6dd7ab9be08d5e14887aa384
2010-10-15Work on issue #3101415: Crespo apps seem to have their UID changed over time.Dianne Hackborn
fsync! Change-Id: Ie6c5397202579935ac69bf61d3e7b3081ecf269c
2010-09-14Add missing wallpaper service lock.Brad Fitzpatrick
Unimportant, but found while reading the code for other reasons. Change-Id: I9f2fad3ff5d081aef7a35e5f33ec5de7dc92195e
2010-03-19Maybe fix issue #2457218: Corrupt batterystats.bin file preventing phone ↵Dianne Hackborn
boot - LIBtt68127 No steps to repro, but makes the code more robust by using the standard JournaledFile class and doing sanity checks on the input it reads. This required moving the JournaledFile class in to the framework (and we really should get rid of either it or AtomicFile, but they have different recovery semantics so that is tough). Also went through and cleaned up the file management in various places. Change-Id: Ieb7268d8435e77dff66b6e67bb63b62e5dea572e
2010-03-11Fix issue #2492387: system server crash in WallpaperManagerServiceDianne Hackborn
Also move some of the important framework error logs over to Slog. Change-Id: If6697c3e4f18498612ebd7b0e4e4f042fd713372
2010-03-05Refactor android.backup => android.app.backupChristopher Tate
Change-Id: I0b21316ff890d7f3c7d4b82837bb60670724c2e8
2010-03-01Switch the services library to using the new SlogJoe Onorato