summaryrefslogtreecommitdiffstats
path: root/cmds/pm
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-6.0.1_r61' into HEADJessica Wagantall2016-08-021-0/+36
|\ | | | | | | | | | | Android 6.0.1 Release 61 (MOB30Z) Change-Id: Ib003ccb606e0d77209291b757ea36399d3b65814
| * Add pm operation to set user restrictions.Sudheer Shanka2016-06-241-0/+36
| | | | | | | | | | Bug: 29189712 Change-Id: I6fdb3b68dfe3f51119e5ce8008880fc7d9c793df
* | pm: Use /system/bin/sh instead of /bin/shLuK13372015-11-101-0/+1
|/ | | | | | We aren't symlinking /system/bin to /bin. Change-Id: Ic49fddfaa4c213b6b399ee53095772e6de45ed57
* Teach Pm about the "always ask" link-handling stateChristopher Tate2015-08-251-0/+1
| | | | | | Bug 23511867 Change-Id: I74b3c8222a7d22541a96b698edd1a175d378e48f
* Make "Ask every time" actually work that wayChristopher Tate2015-08-131-1/+6
| | | | | | | | | | | ..in link-opening behavior. If a candidate is marked as "ask every time," then the user is guaranteed to get a disambiguation prompt including that candidate even when some other candidate app is in the "always prefer this over a browser" state. Bug 23147746 Change-Id: I904d8697a992b3f16f32b1c1b49c2bf9424c7137
* Add 'pm' operation to set a package's app-linking stateChristopher Tate2015-07-201-0/+157
| | | | | | | | | | | | | | | | | | Set an app's state: pm set-app-link [--user USER_ID] PACKAGE {always|ask|never|undefined} Read an app's current state: pm get-app-link [--user USER_ID] PACKAGE The latter prints to stdout one of the strings usable as an argument to set-app-link. If an error is encountered, the string printed to stderr begins with "Error: ". Bug 19628527 Change-Id: I68b6dc24445917807345a8cf5baa2078490740af
* Add grant flag support to "install-create" verb.Jeff Sharkey2015-07-091-0/+2
| | | | | | | This matches the "install" behavior. Bug: 22331569 Change-Id: I07bfe067bd4be01fc92126750b0ff25a5c5ba5c9
* Fix issue #22023824: Download folder is not created in internal storageDianne Hackborn2015-06-261-0/+25
| | | | | | | | | | | The media provider and some other things need to be given storage access. Also, seems like we should give storage access to the camera app as well. And add a dump dump command that will dump data about a particular permission name. Change-Id: Idaaa9bba2ff4dc95290cf6d17e5df933df91e909
* Fix issue #21814207 and issue #21814212 (alarm manager)Dianne Hackborn2015-06-171-1/+1
| | | | | | | | | | | | | | | | | Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks. Introduce a whole new infrastructure for providing options when sending broadcasts, much like ActivityOptions. There is a single option right now, asking the activity manager to apply a tempory whitelist to each receiver of the broadcast. Issue #21814212: Need to allow configuration of alarm manager parameters The various alarm manager timing configurations are not modifiable through settings, much like DeviceIdleController. Also did a few tweaks in the existing DeviceIdleController impl. Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
* Flags to select storage volume for app installs.Jeff Sharkey2015-06-091-0/+10
| | | | | | | | | Remote callers can now provide the "--install-location" value from the APK to help select a location, or they can explicitly force a volume by UUID. Bug: 21676789 Change-Id: Iefc92d770a851fc33e37edbf259fdb8df2b14ae5
* Fix grant/revoke to act on owner by default and log invalid user id.Svet Ganov2015-05-141-1/+1
| | | | | | bug:21163229 Change-Id: I66d0cc130b37b5752ed06afc73259ed41bfb7830
* Add permission meta-state flags to support grant/revoke permission policy.Svet Ganov2015-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | We now maintain a mata-state with each permission in the form of flags specyfying the policy for this permission. This enables support of the following use cases: 1. The user denies a permission with prejudice in which case an app cannot request the permission at runtime. If an app requests such a permssion it gets a denial unless the user grants the permission from settings. 2. A legacy app with disabled app-ops being upgraded to support runtime permissions. The disabled app ops are converted to permission revocations. The app ops manager is a part of the activity manger which sits on top of the package manager, hence the latter cannot have a dependency on the former. To avoid this the package installer which is the global permission managment authority marks the permission as revoked on upgrade and the package manager revokes it on upgrade. 3. A device policy fixing a permission in a granted or revoked state. This additional information is folded in the meta-state flags and neither apps can request such permissions if revoked not the user can change the permission state in the UI. Change-Id: I443e8a7bb94bfcb4ff6003d158e1408c26149811
* Migrate primary external storage.Jeff Sharkey2015-04-241-5/+36
| | | | | | | | | | | | | | | | Wire up through MountService to call down into vold. Watch for unsolicited events that report progress, including special value "82" that signals that copy has finished. We use this value to persist the volumeUuid in case of unexpected reboot, since it indicates the new volume is ready. Wire progress updates through existing callback pipeline. Update the volume mounting code to match against the persisted UUID when selecting the primary external storage. Bug: 19993667 Change-Id: Id46957610fb43517bbfbc368f29b7d430664590d
* Package and storage movement callbacks.Jeff Sharkey2015-04-231-30/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since package and primary storage movement can take quite awhile, we want to have SystemUI surface progress and allow the Settings app to be torn down while the movement proceeds in the background. Movement requests now return a unique ID that identifies an ongoing operation, and interested parties can observe ongoing progress and final status. Internally, progress and status are overloaded so the values 0-100 are progress, and any values outside that range are terminal status. Add explicit constants for special-cased volume UUIDs, and change the APIs to accept VolumeInfo to reduce confusion. Internally the UUID value "null" means internal storage, and "primary_physical" means the current primary physical volume. These values are used for both package and primary storage movement destinations. Persist the current primary storage location in MountService metadata, since it can be moved over time. Surface disk scanned events with separate volume count so we can determine when it's partitioned successfully. Also send broadcast to support TvSettings launching into adoption flow. Bug: 19993667 Change-Id: Ic8a4034033c3cb3262023dba4a642efc6795af10
* Always send volume UUID with installd commands.Jeff Sharkey2015-04-181-2/+6
| | | | | | | | Since packages can be moved to other volumes, all relevant commands to installd now require an explicit volume UUID parameter. Bug: 20275577 Change-Id: Ie84f5bc43c7aada5800b8d71692c7928b42b965e
* Allow silent package install for device owner.Benjamin Franz2015-04-071-1/+2
| | | | | | | | | Allow the device owner to silently install and remove packages using the PackageInstaller APIs. Show notifications to the user after the installation / deletion was successful. Bug: 19422461 Change-Id: I0506e18c510efd9d04c4aea9b60a37456e689615
* Installing packages to expanded storage.Jeff Sharkey2015-04-061-2/+53
| | | | | | | | | | | | | | | | | | | | | | | | PackageManager now offers to load/unload packages when expanded volumes are mounted/unmounted. Expanded storage volumes are still treated as FLAG_EXTERNAL_STORAGE from a public API point-of-view, but this change starts treating the INSTALL_EXTERNAL flag as exclusively meaning ASEC containers. Start tracking the UUID of the volume where a package is installed, giving us a quick way to find relevant packages. When resolving an install location, look across all expanded volumes and pick the one with the largest free space. When upgrading an existing package, continue preferring the existing volume. PackageInstaller now knows how to stage on these volumes. Add new movePackage() variant that accepts a target volume UUID as destination, it will eventually move data too. Expose this move command through "pm" command for testing. Automount expanded volumes when they appear. Bug: 19993667 Change-Id: I9ca2aa328b9977d34e8b3e153db4bea8b8d6f8e3
* Update command line usage for pmAmith Yamasani2015-04-061-1/+1
| | | | | | Include the --user flag. Change-Id: Id2a2bc73f4b7392e308c5946eeb42b21426a1bfd
* Add install option to grant all runtime permissions.Svet Ganov2015-03-241-0/+3
| | | | Change-Id: I72ba67a72025646a3d53611621b0353d3a86677c
* Runtime permissions: per user permission tracking.Svetoslav2015-03-231-6/+17
| | | | | | | | | | | | | | | | | | Before all permissions were granted at install time at once, so the user was persented with an all or nothing choice. In the new runtime permissions model all dangarous permissions (nomal are always granted and signature one are granted if signatures match) are not granted at install time and the app can request them as necessary at runtime. Before, all granted permission to an app were identical for all users as granting is performed at install time. However, the new runtime model allows the same app running under two different users to have different runtime permission grants. This change refactors the permissions book keeping in the package manager to enable per user permission tracking. The change also adds the app facing APIs for requesting runtime permissions. Change-Id: Icbf2fc2ced15c42ca206c335996206bd1a4a4be5
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-1/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* am e5cb6a25: am bb845152: Merge "pm path needs to return 0 when it ↵Hui Shu2015-01-051-1/+1
|\ | | | | | | | | | | | | succeeds." into lmp-mr1-dev * commit 'e5cb6a253afa8faffb85c73779a78c74aead23ae': pm path needs to return 0 when it succeeds.
| * pm path needs to return 0 when it succeeds.Hui Shu2014-12-121-1/+1
| | | | | | | | | | BUG: 18721587 Change-Id: I2136d1933e62a20645517d17c1365d214509de16
* | am 1bafd01a: am 44a5a30a: Merge "Fix "pm list permissions" crash if resource ↵Narayan Kamath2014-12-291-1/+4
|\ \ | |/ |/| | | | | | | | | string missing" * commit '1bafd01a3fc5f94e77d1c18e5a7dcdecddcaa47f': Fix "pm list permissions" crash if resource string missing
| * Merge "Fix "pm list permissions" crash if resource string missing"Narayan Kamath2014-12-291-1/+4
| |\
| | * Fix "pm list permissions" crash if resource string missingDenver Coneybeare2014-06-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "pm list permissions" command lists detailed information about each permission on the system, including its label and description, both of which can be stored as translatable resource strings in APK files. However, it is possible that the resource identifiers for these strings point to non-existent resources. When this happens, the loadText() method throws Resources.NotFoundException, causing the "pm" command to abort prematurely, simply printing "Killed" to stdout and a stack trace to logcat. This commit fixes the crash by explicitly catching the Resources.NotFoundException exception in loadText() and returning null if it is thrown. The loadText() method already has the potential to return null so none of its callers need be modified. This fixes the crash and simply shows "label:null" and/or "description:null" in the output if the string resource is missing. Change-Id: I92273399e1dac6029163750d004940ee1da67428
| | * Add an --abi argument to "pm install"Narayan Kamath2014-06-031-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | This allows callers to force an install to a particular ABI. This is intended only for testing (and CTS) and is not meant for usage by the installer package. Change-Id: Icb1528c0cd35b1aa9323386cb35ff4aaba374fcb
* | | Have Pm return the correct codeEvan Charlton2014-10-311-147/+185
|/ / | | | | | | | | | | | | If the command fails, have Pm return a nonzero exit code. Bug: 18085950 Change-Id: I3de1b8f69aa8f44b2e2109864c1aa093e3b82141
* | Add 'adb dpm' subcommand to set profile ownerEsteban Talavera2014-09-161-4/+0
| | | | | | | | | | | | | | | | | | Required for GTS tests. Needed to relax the restriction that only root user can run 'pm create-user' as GTS tests can't get root permissions. Bug: 17312478 Change-Id: I1841286ddf51756c73018c087a5f29afeb5b9f15
* | Whoops, wait around for pm result.Jeff Sharkey2014-09-151-1/+5
| | | | | | | | | | | | | | | | poll() returns immediately; we want to take() to wait for the result to actually arrive. Bug: 17510699 Change-Id: I87669e79e9941480fed33e4cc8a38de793d59e90
* | Bring install and install-multiple into parity.Jeff Sharkey2014-09-111-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures that both are using (almost) identical logic when deciding what installs to proceed with. Installs from "pm" for all users now run as OWNER, and rely solely on INSTALL_ALL_USERS to express intent. This keeps install session notifications simple. Since installer UID can vary from installer package name, start persisting the UID. Also parse some missing flags for install sessions. Bug: 17469392 Change-Id: I6d89b1a787aa2024cc4bebf6b9c29317c358e147
* | Clean up apks installed for a removed userAmith Yamasani2014-08-291-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a user is removed, enumerate through all installed packages to see if any of them are not installed for any user. Delete the package if no user has it "installed". Added a pm option to install an apk for a specific user. Fixed a crash in UserManagerService when executing the above cleanup - dying users generate a null UserInfo. Bug: 15426024 Change-Id: I571decde1ae1c257d0da6db153b896aad6d6bcb4
* | Installing splits into ASECs!Jeff Sharkey2014-08-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sessions can now zero-copy data directly into pre-allocated ASEC containers. Then at commit time, we compute the total size of the final app, including any inherited APKs and unpacked libraries, and resize the container in one step. This supports both brand new ASEC installs and inheriting from existing ASEC installs. To keep things simple, it currently requires copying any inherited ASEC contents, but this could be optimized in the future. Expose new vold resize command, and allow read-write mounting of ASEC containers. Move native library extraction into the installer flow, since it needs to happen before ASEC is sealed. Move multiArch flag into NativeLibraryHelper, instead of making everyone pass it around. Migrate size calculation to shared location. Separate "other" package name in public API, provide a path to a storage device when relevant, and add more docs. Bug: 16514385 Change-Id: I06c6ce588d312ee7e64cce02733895d640b88456
* | PackageInstaller API refactoring.Jeff Sharkey2014-08-151-95/+66
| | | | | | | | | | | | | | | | Switch to using IntentSender for results to give installers easier lifecycle management. Move param and info objects to inner classes. Bug: 17008440 Change-Id: I944cfc580325ccc07acf22e0c681a5542d6abc43
* | Persist the cpuAbiOverride setting.Narayan Kamath2014-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | If an app is installed with an ABI override (adb install -r --abi) we should remember this so that we don't revert to the scan derived ABI on the next reboot. bug: 16476618 Change-Id: I6085bc0099eb613dd9d3b07113c7c13859780697
* | Surface user action events when un/installing.Jeff Sharkey2014-08-071-6/+13
| | | | | | | | | | | | | | | | This will be used shortly to connect up with permissions confirmation UI. Bug: 16515814 Change-Id: If28cecc28549900d960ac107a1fba0b10ce5bd7b
* | Persist install sessions, more lifecycle.Jeff Sharkey2014-07-311-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To resume install sessions across device boots, persist session details and read at boot. Drop sessions older than 3 days, since they're probably buggy installers. Add session callback lifecycle around open/close to give home apps details about active installs. Also give them a well-known intent to show session details. Extend Session to list staged APKs and open them read-only, giving installers a mechanism to verify delivered bits, for example using MessageDigest, before committing. Switch to generating random session IDs instead of sequential. Defensively resize app icons if too large. Reject runaway installers when they have too many active sessions. Bug: 16514389 Change-Id: I66c2266cb82fc72b1eb980a615566773f4290498
* | Offer force-dex-opt when running as root.Jeff Sharkey2014-07-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently we removed the PackageManager inotify triggers, meaning the only supported ways of installing apps were: -- adb install -r Foo.apk -- adb shell stop && adb sync && adb shell start Iterating on most system apps (like Settings) can use the first approach, but it doesn't work for "persistent" processes like SystemUI. (ActivityManager is very particular about how it deals with persistent apps, and it always sticks with the first ApplicationInfo found at boot.) So to enable rapid iteration on persistent apps, we now offer the one missing piece of forcing a dexopt with a new pm force-dex-opt command only available to -eng or -userdebug builds. Typical use for iterating on persistent apps now looks like this: $ mmm frameworks/base/packages/SystemUI/ && adb sync && adb shell pm force-dex-opt com.android.systemui && adb shell kill `pid systemui` Yay! Change-Id: I0ae2467f1d7cda56c70ba20953cd25fa8ee766ff
* | PackageInstaller changes based on feedback.Jeff Sharkey2014-07-251-19/+22
| | | | | | | | | | | | | | Mostly cosmetic changes from API council feedback. Bug: 16543552 Change-Id: Ic926829b3f77c31f50a899c59b779353daf00d59
* | Rename setApplicationBlocked to setApplicationHiddenAmith Yamasani2014-07-211-10/+10
| | | | | | | | | | | | | | | | This corrects the expected behavior of the app state. Hidden apps can be installed by the store to be brought out of hidden state. Bug: 16191518 Change-Id: Id128ce971ceee99ba1dea14ba07ce03bd8d77335
* | Install sessions only inherit APK files.Jeff Sharkey2014-07-161-5/+6
| | | | | | | | | | | | | | | | | | Also track historical install sessions for debugging purposes. Hide signature verification API for now. Clear code cache only after killing the app being upgraded. Bug: 14975160 Change-Id: I52fc7f11d2506f792236d8a365c8cfed21b46c30
* | Merge "Public API for PackageInstaller!" into lmp-devJeff Sharkey2014-07-151-2/+2
|\ \
| * | Public API for PackageInstaller!Jeff Sharkey2014-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Flesh out documentation and finalize first cut of API. Also surface installLocation and splitNames through PackageInfo. Bug: 14975160, 15348430 Change-Id: Ic27696d20ed06e508aa3526218e9cb20835af6a0
* | | Pass install result message; path selection.Jeff Sharkey2014-07-141-21/+19
|/ / | | | | | | | | | | | | | | Oops, forgot to include message argument to invoke the new-style callback. Also use more robust way of generating cluster APK directory names, and add more logging details on rename failure. Change-Id: Ifa8abdd1db58b73e13b9a8077ec126cf20a0d90e
* | Package installation listener events.Jeff Sharkey2014-07-121-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Flesh out implementation of install session observers. Carve out 20% of published install progress for final system operations such as dexopt, etc. Add dumpsys output for active install sessions. Create explicit fsync() instead of overriding meaning of flush(). Hack to throw IOExceptions over Binder calls. Bug: 14975160, 15348430 Change-Id: I874457e40c45d2661bc0a526df9285ffea4bb77c
* | Progress toward installer public API: callbacks.Jeff Sharkey2014-07-111-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of surfacing all the existing cryptic error codes, we're going to classify them into broad categories when surfacing through public API. This change introduces InstallResultCallback and UninstallResultCallback, and wires them up to existing AIDL interfaces. Also start defining general SessionObserver for apps interested in general progress details, such as Launcher apps. Details about active sessions are returned through new InstallSessionInfo objects. Bug: 14975160 Change-Id: I068e2b0c30135f6340f59ae0fff93c321047f8f9
* | Extend pm to support sessions and split APKs.Jeff Sharkey2014-07-091-44/+223
| | | | | | | | | | | | | | | | | | | | | | | | Separate commands to create an install session, stream files into the staging area, and then commit the install. Streaming can accept data from stdin across adb, avoiding extra copy from push. Extend FileBridge to support blocking close(). Always destroy session regardless of result. Bug: 14975160 Change-Id: Ic3f462e7d1901079b785e210228950cdfa676466
* | Clean up IPackageManager install surface area.Jeff Sharkey2014-07-081-95/+6
| | | | | | | | | | | | Also more removal of encryption support. Change-Id: If525dc5a8422134515f225a8ac4731e968069468
* | Plumb split APKs into public API.Jeff Sharkey2014-06-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | Introduces new ApplicationInfo fields to surface zero or more split APKs for an application. Splice these APKs into both the class loader and resource system. Cleaner building of these paths. Run dexopt() on all split APKs found after a parse, and populate into ApplicationInfo. Change-Id: I4a376bf4492d84ea95aafa866e106ea43a43e492
* | Add an --abi argument to "pm install"Narayan Kamath2014-06-031-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | This allows callers to force an install to a particular ABI. This is intended only for testing (and CTS) and is not meant for usage by the installer package. bug: 14453227 (cherry picked from commit 6431d11cd420536aaa9d93ae510a3151ccc4df1d) Change-Id: I85d4f8785deea02a6a4d3cb0b05e6ef8bf64826b