History log of /frameworks/base/core/java/com/android/internal/content/PackageHelper.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
77d218e1869e69c8d436b09cd11dcfe45e50b2cf 06-Sep-2014 Jeff Sharkey <jsharkey@android.com> Delayed ASEC allocation, refine progress handling.

For restore use-case, session creation needs to complete quickly, so
delay ASEC allocation until session is opened. When preflighting
size checks, only consider external when we have a known size for the
container. Also relax size checks when using MODE_INHERIT_EXISTING
on external, since we don't know how much of existing app will be
copied over.

Consider session as "active" while commit is ongoing, until we're
either finished or pending user interaction.

Always publish first client needle movement away from 0. Use 25% of
internal progress to reflect ASEC allocation.

Avoid CloseGuard messages about leaking PFDs.

Bug: 17405741, 17402982
Change-Id: I6247a1d335d26621549c701c4c4575a8d16ef8c2
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
941a8ba1a6043cf84a7bf622e44a0b4f7abd0178 21-Aug-2014 Jeff Sharkey <jsharkey@android.com> Installing splits into ASECs!

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
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
bb7b7bea19223c1eba74f525c7fe87ca3911813b 20-Aug-2014 Jeff Sharkey <jsharkey@android.com> More progress towards split APKs in ASECs.

Teach DefaultContainerService to install split APKs, which will be
needed when moving to/from ASECs. Also support forward locking for
testing purposes, even though its deprecated.

Move native library unpacking code to NativeLibraryHelper location
where it can be shared by both DCS and PMS. Also update footprint
calculation logic to mirror the later unpack codepaths.

Immediately persist sealed sessions. When resolving install
locations, prefer location of any existing install of that
package. Lightweight parse requesting certificates now always
verifies that all contents are signed correctly.

Bug: 16514385
Change-Id: Ida1c4eb0f95b065104dd971e19126d4085ebf1f0
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
742e790294b3441b79f715fe447069b63c6065db 17-Aug-2014 Jeff Sharkey <jsharkey@android.com> Progress towards staging ASECs.

Move location selection logic into shared PackageHelper location,
and share it between DCS and PackageInstaller. Fix bugs related to
installed footprint calculation; always count unpacked native libs.

Have PMS do its own threshold checking, since it's fine to stat
devices. PMS only ever deleted staging ASECs, so move that logic
into installer and nuke unclaimed staging ASECs. Allocate legacy
ASEC names using PackageInstaller to make sure they don't conflict
with sessions.

Start wiring up session to allocate ASEC and pass through staged
container for installation.

Fix bug to actually delete invalid cluster-style installs.

Bug: 16514385
Change-Id: I325e0c4422fc128398c921ba45fd73ecf05fc2a9
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
be520fba1e45c77ca20eb66005a0cf19e10939a1 05-Jul-2014 Jeff Sharkey <jsharkey@android.com> Teach DCS about cluster packages.

For the time being, DCS is going to still be doing heavy lifting for
some install tasks, so it need to know how to handle both monolithic
and cluster packages. This change is mostly plumbing work to
eventually handle any various splits APKs that we may encounter.

Bug: 14975160
Change-Id: I39848d5666f9083cb4eca493e5cdaa868f3f99fb
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
40e9f2922cae76ffcbc521481e5be8e80e8744ef 28-Nov-2012 Dianne Hackborn <hackbod@google.com> Quiet down a lot of logging.

Also fix a little problem where the USER_STARTED broadcasts
were not being sent as ordered broadcasts(!).

Change-Id: I3aa3e0a9b3900967cdd2d115ee103371b0a50c41
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
7767eac3232ba2fb9828766813cdb481d6a97584 24-Aug-2012 Dianne Hackborn <hackbod@google.com> Keep track of whether an app is installed for each user.

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
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
07ba2ae327dbf209da5bafee9cdcb40e03e29d58 09-May-2012 Kenny Root <kroot@google.com> Throw RemoteException when MountService is not yet up

Instead of throwing NullPointerException when getMountService() returns
null, simply throw RemoteException so the code calling getMountService()
can fail gracefully.

Bug: 6461657
Change-Id: Ibefc17de3e0024eb73bbd24914759c0a404f538e
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
6dceb88f1c7c42c6ab43834af2c993d599895d82 12-Apr-2012 Kenny Root <kroot@google.com> Allow forward locked apps to be in ASECs

We couldn't put forward-locked apps in ASEC containers before since we
didn't have any permissioned filesystems. This adds the ability for
forward-locked applications to be in ASEC containers.

This means that forward locked applications will be able to be on the SD
card now.

This change also removes the old type of forward-locking that placed
parts of apps in /data/app-private. Now all forward-locked applications
will be in ASEC containers.

Change-Id: I17ae0b0d65a4a965ef33c0ac2c47e990e55707ad
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
2782a478d0214cf71a32d4537fc9fb191d1072fb 15-Apr-2012 Kenny Root <kroot@google.com> Move forward lock utilities to PackageHelper

The forward lock utilities will need to be called from
DefaultContainerService for ASEC packages in the future. Move them to
PackageHelper to aid in the transition.

Also move the public resource copying to the FileInstallArgs step which
makes a little bit more sense.

Change-Id: I3a62ac817719db3ee1c89c106a551dcbe9c44744
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
1ebd74acf9977daa42133507e970dab88e08f0ef 04-Aug-2011 Kenny Root <kroot@google.com> Better error codes for missing files

Make sure that files that don't exist aren't returning bogus 'out of
space' error codes.

Add some Javadoc so I can remember what each thing does in an IDE.

Add copyright header to NativeLibraryHelper

Bug: 3375299
Change-Id: Iac46019160921daca65b21d38897e5165063316e
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
292f8bc9d1b790ab975a87a842c7fabc908b97e0 28-Jun-2011 Dianne Hackborn <hackbod@google.com> Plumb information from the framework about asec container size.

Change-Id: Ie0ec3cb6d463aefa341a8cbea80be790451ba5e3
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
62e1b4e9d41a01db423b5e4684ecf529ed46106d 15-Mar-2011 Kenny Root <kroot@google.com> Revise free space checks for package installs

Change-Id: Ie72bbab77aa89a50ec096edc1f471eab74829e67
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
85387d7ba36e56b291cbde87acb5a5b2200fe01c 26-Aug-2010 Kenny Root <kroot@google.com> Allow native shared libraries in ASEC containers

This change moves the native library handling earlier in the package
installation process so that it may be inserted into ASEC containers
before they are finalized in the DefaultContainerService.

Note that native libraries on SD card requires that vold mount ASEC
containers without the "noexec" flag on the mount point.

Change-Id: Ib34b1886bf6f94b99bb7b3781db6e9b5a58807ba
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
8a9ab24a5c9b595ac0268fcade4b5bbfe7c45c2d 12-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Do storage checks before initiating a move.
Add new remote method to check for insufficient error conditions.
Some fixes in MountService when updating media status on PackageManagerService
Fix size calculation condition in installd.

Add new error code if media is unavailable.
New tests for testing error codes.
Some additional debugging statements in MountService.

Change-Id: Ibfe90d5ed6c71d57f9c1c67806f38b5ae9ecdfbf
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
089262dc022d87e31eefc536025be6c015c7ebde 10-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Dont include code size for apps on sdcard.
Use constants defined in PackageHelper for user preferences
to install auto, internal, external.
Set default install location to external.
Update settings db version number

Change-Id: Ib5110c9377990e20a48cee923e55898dfddfd1e6
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
a2b6c3775ed6b8924232d6a01bae4a19740a15f8 06-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Add conditions to check for updated system applications. Restrict them
to internal flash only even before we copy.

Return error codes when install flag options mismatch.
Some conditions for existings apps
- install flags override existing location
- explicity manifest option install location overrides previous location
- if upgraded package's install location is unspecified or auto, fall
back to recommended install policy which considers user setting as well.

Check for sdcard status before finding available size on sdcard
Add light weight parsing for manifest attributes including package name and
install location only

Change-Id: I5143dda87c88c595f564b317326c926d0ec3ceb8
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
9b10ef5fe85e9d29721ff0cd15161f960d38a8db 03-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Rework the way PackageManager binds to default container service.

Clean up stale containers when enabling/disabling packages on sdcard.
Check the path of packages which are being enabled.
Make sure gc's are done prior to destroying containers when moving applicati
as well as enabling/disabling packages for sdcard mount status changes.

Some miscellaneous issues
Remove hack to avoid renaming containers.
Fix test with forward locked apps
Remove adding container id to asec list when renaming
Some cosmetic changes to DefaultContainerService
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
cf6eaeaae9e6745dd6e07540812c79821d7043c2 24-Feb-2010 Suchi Amalapurapu <asuchitra@google.com> Some framework fixes for apps on sd
change hard coded path in installd
fix tests
Work around for renaming containers.
Do forced unmount when destroying containers.
Force a gc in default container service to release handle to parsed package
and thus avoid getting killed by vold
Some cosmetic changes to PackageManager api.
Unit tests for renaming container for MountService
Remove internal size limit on app to be installed.
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
d970998b0d489774ad1c5b94b47d233912f00214 18-Feb-2010 San Mehat <san@google.com> framework: storage: Add 'force' option to unmount/destroy storage apis, and update callsites.

Also adds additional storage unit tests

Signed-off-by: San Mehat <san@google.com>
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
679bba339ef6948091180c776d6a284cddd812f5 16-Feb-2010 Suchi Amalapurapu <asuchitra@google.com> Move mount service wrapper calls to PackageHelper

Fix bug related to forward locked apps.
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java
5b993ce7bc29e43a3215a50ce6ce5d6550d4e5e2 12-Feb-2010 Suchi Amalapurapu <asuchitra@google.com> Include install location preference when installing packages.
Changes include
Add new remote call in default container service to determine
install location.
Rename INSTALL_ON_SDCARD
Remove recommentAppInstall method
Add some additional flags used in remote stubs.
Move check for protected apps prior to copy.
Unit tests

DefaultContainerService first parses the file uri(if content uri is specified
it returns a default install internal only value) and returns
a recommended location. Based on which the temporary id is determined
either a file name or a container id and the file is copied there.
This is then later renamed during install.
Todo's light weight parsing of package when determining location since we
just need the install location attribute only when finding out
recomended location. This will also enable to move the check for
updated system apps(cannot be on sdcard) prior to copying.
/frameworks/base/core/java/com/android/internal/content/PackageHelper.java