summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/am/ProviderMap.java
AgeCommit message (Collapse)Author
2013-12-19Move some system services to separate directoriesAmith Yamasani
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
2013-06-11Add new API to retrieve a dumpsys of a single package.Dianne Hackborn
Adds a platform API, and pm command. Fixes some issues with dumping per-package data in package manager, makes battery stats able to dump per-package state. Change-Id: I76ee6d059f0ba17f7a7061886792b1b716d46d2d
2013-06-07Initial super-primitive process tracker.Dianne Hackborn
The goal of this is to keep track of what app processes are doing, to determine who is being abusive, when the system is getting into memory constrained situations, and help the user determine how to resolve this. Right now it doesn't really do any of that, just keeps track of how long every process has been running since boot. Also update the activity manager to use "cached" as the terminology for what it used to interchangeably call hidden and background processes, and switch ProcessMap over to using ArrayMap. Change-Id: I270b0006aab1f38e17b7d9b65728679173c343f2
2013-06-06Improve debug printing in activity manager.Dianne Hackborn
Dumping per-package data is now much cleaning, and only really prints information related to the package. Also clean up the formatting and such of the new activity stack states. Change-Id: Ie5f31d72b7e77b34fd9acd835f28ed1db1dff328
2013-05-30Clean up some temporary allocations.Dianne Hackborn
Yay to ArrayMap, letting me get rid of a bunch of temporary iterators in core code paths like updateOomAdj. (Now I definitely need an ArraySet to finish that up.) Also clean up various other things that are doing unnecessary allocations, clean up some debug output, make more of the debug output respect package filtering. Change-Id: Ib4979faf4de8c7912739bc0937c3fa9e7bfcde67
2012-09-09Various fixes.Dianne Hackborn
Bug #7132226: Can't start instrumentation due to ActivityManagerService crash Bug #6912004: tap on gmail notification sends me to home screen Change-Id: I824128b01f368de95dee288f8e49039b84479a7e
2012-09-07More multi-user stuff:Dianne Hackborn
- New (hidden) isUserRunning() API. - Maintain LRU list of visited users. - New FLAG_IS_DATA_ONLY for ApplicationInfo. - Clean up pending intent records when force-stopping a user (or package). (Also fixes bug #6880627: PendingIntent.getService() returns stale intent of force stopped app) - Fix force-stopping when installing an app to do the force-stop across all users for that app. - When selecting which processes to kill during a force stop, do this based on the actual packages loaded in the process, not just process name matching. - You can now use --user option in am when starting activities, services, and instrumentation. - The am --user option accepts "current" and "all" as arguments. - The pm uninstall command now uninstalls for all users, so it matches the semantics of the install command. - PhoneWindowManager now explicitly says to start home in the current user. - Activity manager call to retrieve the MIME type from a content provider now takes a user argument, so it will direct this to the proper user. - The package manager uninstall paths are now implemented around PackageSetting, not PackageParser.Package. This allows them to work even if the application's apk has been removed (in which case it only exists as a PackageSetting, not the PackageParser.Package parsed from the apk). Change-Id: I3522f6fcf32603090bd6e01cc90ce70b6c5aae40
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-20am ff7735b0: am a3db5297: Merge "ProviderMap: remove hashmap when entire ↵Amith Yamasani
user specific entries are removed" * commit 'ff7735b0ee8c3347d0f3cb1866e454be0e9534e2': ProviderMap: remove hashmap when entire user specific entries are removed
2012-08-16Rename UserId to UserHandle.Dianne Hackborn
This is the start of turning this into a formal public API. Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
2012-08-15ProviderMap: remove hashmap when entire user specific entries are removedVairavan Srinivasan
User specific entries in mProvidersByNamePerUser and mProvidersByClassPerUser isn't cleared when entire user specific providers are removed. Fix is to remove the user specific hashmap in such cases. Change-Id: I6edf211ced873e59f3b89ffceb9eceec13ea8f3f
2012-08-13Small service cleanup.Dianne Hackborn
Get rid of duplication between find/retrieve service funcs; when a service in a persistent process crashes, restart it immediately since the persistent process is going to be immediately restarted anyway; when a new process is attaching, immediately restart any services associated with it that are waiting to restart, since it is weird to not let them run if the process comes back for some other reason. Change-Id: Id087fe04ebf2b6a4bd00732796c8326364765ea7
2012-08-07More mult-user API work.Dianne Hackborn
- You can now use android:singleUser with receivers and providers. - New API to send ordered broadcasts as a user. - New Process.myUserHandle() API. For now I am trying out "user handle" as the name for the numbers representing users. Change-Id: I754c713ab172494bb4251bc7a37a17324a2e235e
2012-05-29Fix (mostly) issue #5109947: Race condition between retrieving a...Dianne Hackborn
...content provider and updating its oom adj This introduces the concept of an "unstable" reference on a content provider. When holding such a reference (and no normal stable ref), the content provider dying will not cause the client process to be killed. This is used in ContentResolver.query(), .openAssetFileDescriptor(), and .openTypedAssetFileDescriptor() to first access the provider with an unstable reference, and if at the point of calling into the provider we find it is dead then acquiring a new stable reference and doing the operation again. Thus if the provider process dies at any point until we get the result back, our own process will not be killed and we can safely retry the operation. Arguably there is still the potential for a race -- if somehow the provider is killed way late by the OOM killer after the query or open has returned -- but this should now be *extremely* unlikely. We also continue to have the issue with the other calls, but these are much less critical, and the same model can't be used there (we wouldn't want to execute two insert operations for example). The implementation of this required some significant changes to the underlying plumbing of content providers, now keeping track of the two different reference counts, and managing them appropriately. To facilitate this, the activity manager now has a formal connection object for a client reference on a content provider, which hands to the application when opening the provider. These changes have allowed a lot of the code to be cleaned up and subtle issues closed. For example, when a process is crashing, we now have a much better idea of the state of content provider clients (olding a stable ref, unstable ref, or waiting for it to launch), so that we can correctly handle each of these. The client side code is also a fair amount cleaner, though in the future there is more than should be done. In particular, the two ProviderClientRecord and ProviderRefCount classes should be combined into one, part of which is exposed to the ContentResolver internal API as a reference on a content provider with methods for updating reference counts and such. Some day we'll do that. Change-Id: I87b10d1b67573ab899e09ca428f1b556fd669c8c
2012-03-15Fix swiping away recents to always kill processes.Dianne Hackborn
This would only kill processes if there were activities associated with the recent task; now it always kills processes. Always fix some debug output. Change-Id: Iccda19ba0a20823347b06c13b450587283d28284
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
2012-02-08Fix "dumpsys activity provider"Marco Nelissen
Change-Id: Ic0678a6edb539bb5648529dd9c38a382bc9cc3fb
2012-02-03Multi-user - 1st major checkinAmith Yamasani
Switching activity stacks Cache ContentProvider per user Long-press power to switch users (on phone) Added ServiceMap for separating services by user Launch PendingIntents on the correct user's uid Fix task switching from Recents list AppWidgetService is mostly working. Commands added to pm and am to allow creating and switching profiles. Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed