summaryrefslogtreecommitdiffstats
path: root/cmds/pm
Commit message (Collapse)AuthorAgeFilesLines
* Single-user restrictionsAmith Yamasani2013-06-251-0/+42
| | | | | | | | | | | Introduces a new "blocked" state for each package. This is used to temporarily disable an app via Settings->Restrictions. PIN creation and challenge activities for use by Settings and other apps. PIN is stored by the User Manager and it manages the interval for retry attempts across reboots. Change-Id: I4915329d1f72399bbcaf93a9ca9c0d2e69d098dd
* Add new API to retrieve a dumpsys of a single package.Dianne Hackborn2013-06-111-2/+21
| | | | | | | | 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
* Keep track of who has disabled applications.Dianne Hackborn2013-03-271-1/+2
| | | | Change-Id: I2640d3dc2200b589e2beb42a43cc93efd090f06e
* Do not hang in pm clear on an invalid package nameChristopher Tate2013-03-071-4/+1
| | | | | | | | | The Activity Manager was not properly informing the observer that the operation had concluded (unsuccessfully). Bug 8222595 Change-Id: I8234e32d8edf4112c8c7a5e20e341d0b41e23014
* Shared accounts and sharing of appsAmith Yamasani2013-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | API and preliminary implementation for sharing primary user accounts with a secondary user. AbstractAccountAuthenticator has new methods to retrieve and apply a bundle of credentials to clone an account from the primary to a restricted secondary user. The AccountManagerService initiates the account clone when it starts up the user and detects that the user has a shared account registered that hasn't been converted to a real account. AccountManager also has new hidden APIs to add/remove/get shared accounts. There might be further improvements to this API to make shared accounts hidden/visible to select apps. AccountManagerService has a new table to store the shared account information. Added ability in PackageManager to install and uninstall packages for a secondary user. This is required when the primary user selects a few apps to share with a restricted user. Remove shared accounts from secondary users when primary user removes the account. Change-Id: I9378ed0d8c1cc66baf150a4bec0ede56f6f8b06b
* Fix issue #8133857: Tracking ANR in GalleryDianne Hackborn2013-02-081-2/+3
| | | | | | | | | | | | Reworking the locking in resources so that we never hold the state lock while calling in to potential long running operations. This means the mTmpValue can no longer be final (since we need to use it while the lock isn't held), so a new field needs to be added as the lock and everything that touches mTmpValue must deal with it being null, restoring the value in there when possible, etc. Change-Id: Ie5ffd0f66e5f2d0e869a62d72e7a55b1c74fe872
* Add new disabled state for "optional" built-in apps.Dianne Hackborn2013-01-221-0/+8
| | | | | | | | | | | | | | | The disabled state allows you to make an app disabled except for whatever parts of the system still want to provide access to them and automatically enable them if the user want to use it. Currently the input method manager service is the only part of the system that supports this, so you can put an IME in this state and it will generally look disabled but still be available in the IME list and once selected switched to the enabled state. Change-Id: I77f01c70610d82ce9070d4aabbadec8ae2cff2a3
* Rework ParceledListSlice to be much easier to use.Dianne Hackborn2013-01-181-11/+2
| | | | | | | | | | | | | | | Take advantage of this to return better information about packages filtered by permissions -- include the permissions they have in the requested array. Also fix issue #8026793 (Contact picture shows default pic while searching for a contact in qsb) by using the base package name of the Context when reporting the app name of an operation. Otherwise you could make a resource-only context for another application and do calls through that and get reported as the wrong app. Change-Id: I5e0488bf773acea5a3d22f245641828e1a106fb8
* Support pm clear as --user.Jeff Sharkey2012-10-151-4/+16
| | | | | Bug: 7352703 Change-Id: I0e9cc4f2313e5424d234c3cb051004c0321d9dac
* Pm command to get maximum users.Jeff Sharkey2012-10-121-2/+16
| | | | | | | | Used to drive CTS tests. Also print success message when removing a user. Bug: 7334718 Change-Id: Ia3886ddf860cd000ce567b0fed2ef0a4e2a2295c
* Print newly generated userId.Jeff Sharkey2012-10-111-1/+4
| | | | | Bug: 7334718 Change-Id: Id4dc456b079bebbe9f2d7ea2a8343d2215f296dc
* Pass the originating uid to the package verifierBen Gruver2012-09-271-1/+1
| | | | | Bug: 6923241 Change-Id: I85a3e0d53b469543cb0551d3a440d2663b5d0697
* Query users excluding any being removedAmith Yamasani2012-09-201-1/+1
| | | | | | | | | | Keep track of user creation and last logged-in time. adb shell dumpsys users User switcher shouldn't show users about to be removed. No need to check for singleton for activities. Bug: 7194894 Change-Id: Ic9a59ea5bd544920479e191d1a1e8a77f8b6ddcf
* More multi-user methods in PMAmith Yamasani2012-09-081-4/+8
| | | | | | | | pm can list installed packages by user now. Bug: 6926465 Change-Id: I822311bfd6e7e2d6fb315fc484739fbf953c9bb6
* More multi-user stuff:Dianne Hackborn2012-09-071-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Remove Binder.getOrigCallingUid().Dianne Hackborn2012-08-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix installing applications from non-primary users.Dianne Hackborn2012-08-271-51/+10
| | | | | | | | | | | | | | | | | We also now send the correct broadcasts to each user. You no longer need to be running the shell as root to be able to create/remove users. Also added some more man page material to the pm command, and got rid of a bunch of showUsage() calls that now make error messages completely buried because of how large the usage info has become. And the package manager now shows the user each historical broadcast was sent to. Change-Id: Iab42498e1352a0c023069139c80fc04d2d69ab4b
* Restore man page entries.Dianne Hackborn2012-08-271-3/+6
| | | | Change-Id: I002808037ec117c039aeb71f425c1f43d4cac6d8
* Keep track of whether an app is installed for each user.Dianne Hackborn2012-08-241-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This add a new per-user state for an app, indicating whether it is installed for that user. All system apps are always installed for all users (we still use disable to "uninstall" them). Now when you call into the package manager to install an app, it will only install the app for that user unless you supply a flag saying to install for all users. Only being installed for the user is just the normal install state, but all other users have marked in their state for that app that it is not installed. When you call the package manager APIs for information about apps, uninstalled apps are treated as really being not visible (somewhat more-so than disabled apps), unless you use the GET_UNINSTALLED_PACKAGES flag. If another user calls to install an app that is already installed, just not for them, then the normal install process takes place but in addition that user's installed state is toggled on. The package manager will not send PACKAGE_ADDED, PACKAGE_REMOVED, PACKAGE_REPLACED etc broadcasts to users who don't have a package installed or not being involved in a change in the install state. There are a few things that are not quite right with this -- for example if you go through a full install (with a new apk) of an app for one user who doesn't have it already installed, you will still get the PACKAGED_REPLACED messages even though this is technically the first install for your user. I'm not sure how much of an issue this is. When you call the existing API to uninstall an app, this toggles the installed state of the app for that user to be off. Only if that is the last user user that has the app uinstalled will it actually be removed from the device. Again there is a new flag you can pass in to force the app to be uninstalled for all users. Also fixed issues with cleaning external storage of apps, which was not dealing with multiple users. We now keep track of cleaning each user for each package. Change-Id: I00e66452b149defc08c5e0183fa673f532465ed5
* Pass URLs to package verifiersrich cannings2012-08-201-3/+38
| | | | | | | | This change passes the originating URL and accompanied referrer to package verifiers, when available. Bug: 6544677 Change-Id: I9ebc71bc13f549bd88267e444816151a99bda000
* User Manager service to manage users and query user detailsAmith Yamasani2012-08-111-3/+8
| | | | | | | | | | Moved a bunch of methods from PackageManager to UserManager. Fix launching of activities from recents to correct user. Guest creation APIs Change-Id: I0733405e6eb2829675665e225c759d6baa2b708f
* Revert "Pass URLs to package verifiers"Rich Cannings2012-08-081-18/+2
| | | | | | This reverts commit 24713907fe4632d263aea82f7a35c8fb08918a09 Change-Id: Ie04ba73475b813635c4a74915c45e83250801b6b
* Pass URLs to package verifiersrich cannings2012-08-021-2/+18
| | | | | | | | This change passes the originating URL and accompanied referrer to package verifiers, when available. Bug: 6544677 Change-Id: If9ff6663ad7f3426b7aea2aceb1413b689788138
* Improve cleanup of file caches.Dianne Hackborn2012-07-121-1/+78
| | | | | | | | | | | | | | | | | | | This rewrites installd's code for deleting cache files to be better: - Isn't really stupid about just deleting directories in the order they are found on the filesytem; now collects all cache files and sorts them by mod time to determine which to delete. - Also deletes cache files in /data/media and for all users. This also tweaks DeviceStorageMonitor to be a little smarter about deciding when to flush cache files, having upper and lower limits that it allows memory to get down to and then flash files to reach the higher free storage limit. This should reduce the amount that we perform flushing when starting to reach the storage limit. Finally add a new pm command to force a cache flush. Change-Id: I02229038e1ad553d1168393e5cb6d5025933271d
* Remove some unnecessary man page entriesAmith Yamasani2012-05-301-6/+3
| | | | Change-Id: I1ceda3f5efac83b80ab4b6e7cae4086aeed5062a
* Add encryption parameters to package installationAnonymous Coward2012-05-071-4/+131
| | | | Change-Id: Ic9f8ab9f8110f08bb3c00725cfce5b8ee7b766f3
* Change permission enforcement through pm command.Jeff Sharkey2012-04-301-0/+33
| | | | | | | | Add "set-permission-enforced", which can currently only mutate enforcement of READ_EXTERNAL_STORAGE. Bug: 6363043 Change-Id: I3f7929738c8c36b0a54fbf171c03fe16c09b5d99
* Package restrictions per userAmith Yamasani2012-03-221-25/+50
| | | | | | | | | | | | | | | | | | | Packages can be enabled/disabled per user. This requires maintaining stopped/launched states and enabled / disabled components and packages per user. Refactored pm.Settings and PackageSettingsBase to keep track of states per user. Migrated the stopped-packages.xml to users/<u>/package-restrictions.xml Changed intent resolution to handle individual user restrictions. Bunch of IPackageManager calls now have a userId argument. Make AppWidgetService handle removals of packages. Added some tests for pm.Settings and PackageManager. Change-Id: Ia83b529e1df88dbcb3bd55ebfc952a6e9b20e861
* New development permissions.Dianne Hackborn2012-02-231-18/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are permissions that an application can request, but won't normally be granted. To have the permission granted, the user must explicitly do so through a new "adb shell pm grant" command. I put these permissions in the "development tools" permission group. Looking at the stuff there, I think all of the permissions we already had in that group should be turned to development permissions; I don't think any of them are protecting public APIs, and they are really not things normal applications should use. The support this, the protectionLevel of a permission has been modified to consist of a base protection type with additional flags. The signatureOrSystem permission has thus been converted to a signature base type with a new "system" flag; you can use "system" and/or "dangerous" flags with signature permissions as desired. The permissions UI has been updated to understand these new types of permissions and know when to display them. Along with doing that, it also now shows you which permissions are new when updating an existing application. This also starts laying the ground-work for "optional" permissions (which development permissions are a certain specialized form of). Completing that work requires some more features in the package manager to understand generic optional permissions (having a facility to not apply them when installing), along with the appropriate UI for the app and user to manage those permissions. Change-Id: I6571785c6bb5f6b291862b7a9be584885f88f3a5
* Multi-user - 1st major checkinAmith Yamasani2012-02-031-16/+44
| | | | | | | | | | | | | | | 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
* Add a command option to display installerPackageNameAshish Sharma2011-12-091-2/+11
| | | | Change-Id: I2e5cb5891c610531d9ba7c359fd5dd521f8ecfec
* Infrastructure to support package verifierKenny Root2011-08-151-4/+19
| | | | | | | Allow a package verifier to approve or disapprove of a package being installed. Change-Id: Ibfea0f2b1aaa4ab1589a4e59f96144702b9bf94b
* Small cleanup of am/pm commands.Dianne Hackborn2011-06-241-51/+50
| | | | Change-Id: I5af730bc177635821a82d4dd3ec9130a5dcd525a
* Implement remaining infrastructure for user disabling apps.Dianne Hackborn2011-06-171-0/+7
| | | | Change-Id: If8135eb0e27ec36f8f159eb7b6397add7acd0299
* resolved conflicts for merge of b2d0ee16 to masterKenny Root2011-05-191-1/+19
|\ | | | | | | Change-Id: I4483a6d0ccecfea4a1e66bb6eba80d13e8b9a3a4
| * resolved conflicts for merge of 2433c443 to honeycomb-plus-aospKenny Root2011-05-191-2/+19
| |\ | | | | | | | | | Change-Id: I3385f57e5761679e6700bcbe3c41deb3ecd43ba1
| | * am f2006f31: Merge "Break apart queries to getInstalled* API" into gingerbreadKenny Root2011-05-191-2/+19
| | |\ | | | | | | | | | | | | | | | | * commit 'f2006f3123dcdf598e052051041b49c89710b53e': Break apart queries to getInstalled* API
| | | * Break apart queries to getInstalled* APIKenny Root2011-04-191-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid blowing past the Binder IPC limit, change the PackageManagerService to have a DB-like interaction where the client tells the service the last "row" that it read. The fact that we use a HashMap instead of a TreeMap makes this problematic. For now we're just making a new ArrayList for the keys and then sorting them for each call. This can make the API slower for callers of this, but it's probably greatly overshadowed by the cost of the data transfer itself. Bug: 4064282 Change-Id: Ic370fd148d4c3813ae4f2daffa1a7c28d63d5a09
| | * | am cd23823d: Merge "Fix issue # 3227963: SecurityException: Neither user ↵Dianne Hackborn2011-01-091-0/+59
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | 10023 nor..." into gingerbread * commit 'cd23823d4f533431c76baa104eb50b7803b3b391': Fix issue # 3227963: SecurityException: Neither user 10023 nor...
* | | | resolved conflicts for merge of 0e59729b to masterDianne Hackborn2011-05-121-4/+15
|\ \ \ \ | |/ / / | | | | | | | | Change-Id: I2d3a6bddf66b1df0c101c45ea2fec1cf65caf01b
| * | | New compat mode front end: UI and persistence.Dianne Hackborn2011-05-121-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a really crappy UI for toggling compat mode. Persists compat mode selection across boots. Turns on compat mode by default for newly installed apps. Change-Id: Idc83494397bd17c41450bc9e9a05e4386c509399
* | | | Plumbing in PackageManager and installd for multi-user support.Amith Yamasani2011-04-151-1/+71
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Create /data/user directory and symlink /data/user/0 -> /data/data for backward compatibility - Create data directories for all packages for new user - Remove data directories when removing a user - Create data directories for all users when a package is created - Clear / Remove data for multiple users - Fixed a bug in verifying the location of a system app - pm commands for createUser and removeUser (will be disabled later) - symlink duplicate lib directories to the original lib directory Change-Id: Id9fdfcf0e62406a8896aa811314dfc08d5f6ed95
* | | Switch to returnCode for IPackageDeleteObserverKenny Root2011-03-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Before the IPackageDeleteObserver only knew whether the deletion succeeded or failed, but not the reason why. Bug: 2520191 Change-Id: I1f0d7c04f06c539660b6e17e7e133defb0f61b5b
* | | Merge commit '690d20bb53ba2485f59d128b365eff991d5cc3e6' into manualmergeDianne Hackborn2011-01-091-0/+59
|\ \ \ | | |/ | |/|
| * | Fix issue # 3227963: SecurityException: Neither user 10023 nor...Dianne Hackborn2010-12-221-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...current process has android.permission.WAKE_LOCK When updating a system app, we would actually uninstall the package of the system app, which also meant removing its uid...! It was just luck that we would get the same uid when installing the update after that. During that time, if anyone tried to do anything related to that uid, it would be unknown. This change tweaks how we go about replacing system apps by making it more like normal apps -- to make this work, if we need to disable the system app, we generate a new PackageSetting from the current system app and replace it into our data structures, so we can update that without trashing the current correct information about the (still actually there) system app. Also fixed a problem where we were not killing the currently running app before installing, like we do when updating a normal application. And fixed a problem where we were not deleting the /data .apk when uninstalling a system app update. And added a new option to the "pm" command to clear the data associated with an app. Change-Id: I0e879677849aa42950a3c360bf78ad820e87674b
* | | resolved conflicts for merge of 78e9f4cb to masterDianne Hackborn2010-12-131-8/+68
|\ \ \ | | |/ | |/| | | | Change-Id: I1135361e6d66f524c3f349e2bf1f31bd4191c634
| * | am e4a59519: Fix issue #3154576: battery stats checkin should include UID -> ↵Dianne Hackborn2010-12-131-8/+68
| |\ \ | | |/ | | | | | | | | | | | | | | | packages+ map * commit 'e4a5951925f16f18dae91ed65567e96528f17fee': Fix issue #3154576: battery stats checkin should include UID -> packages+ map
| | * Fix issue #3154576: battery stats checkin should include UID -> packages+ mapDianne Hackborn2010-12-131-8/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Includes some other small fixes to battery collection and a few other things. Output of package info looks like this: 5,0,i,uid,1000,com.android.settings 5,0,i,uid,1000,com.android.providers.subscribedfeeds 5,0,i,uid,1000,com.android.providers.settings 5,0,i,uid,1000,com.android.server.vpn 5,0,i,uid,1000,android 5,0,i,uid,1000,com.android.systemui 5,0,i,uid,1000,com.google.android.backup 5,0,i,uid,1001,com.android.phone 5,0,i,uid,1001,com.android.providers.telephony 5,0,i,uid,1022,com.android.nfc 5,0,i,uid,10021,com.google.android.location 5,0,i,uid,10021,com.google.android.syncadapters.calendar 5,0,i,uid,10021,com.google.android.gsf 5,0,i,uid,10021,com.google.android.syncadapters.contacts 5,0,i,uid,10026,com.android.providers.downloads.ui 5,0,i,uid,10026,com.android.providers.media 5,0,i,uid,10026,com.android.providers.drm 5,0,i,uid,10026,com.android.providers.downloads 5,0,i,uid,10032,com.android.launcher 5,0,i,uid,10039,com.google.android.gm 5,0,i,uid,10041,com.google.android.gallery3d 5,0,i,uid,10049,com.android.providers.calendar Change-Id: I9e38f254eef146339113ad270f5c6e8b60fb7a1d
* | | am b087ceea: am 40eade14: Merge from open-source masterJean-Baptiste Queru2010-12-021-3/+5
|\ \ \ | |/ / | | | | | | | | | * commit 'b087ceead79bcb304e5793c6ae9109ce590847dc': Fix crash by "adb shell pm list permissions -f|-s"
| * | Fix crash by "adb shell pm list permissions -f|-s"Ali Utku Selen2010-11-301-3/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | pm command makes the assumption that every permission should contain android:description and android:label attributes while they are not mandatory. If a permission does not contain these two attributes, we get "android.content.res. Resources$NotFoundException: String resource ID #0x0" followed by a NPE when using -f or -s options. With the following change, users will get "null" in output for respective fields. Change-Id: I4e7f407592fa071abdab1d979775f46ec27dc9d2