OSDN Git Service

Reduce PackageInstaller I/O pressure.
authorJeff Sharkey <jsharkey@android.com>
Mon, 6 Oct 2014 22:14:27 +0000 (15:14 -0700)
committerJeff Sharkey <jsharkey@android.com>
Mon, 6 Oct 2014 23:38:15 +0000 (16:38 -0700)
commit02bd78490d8594d225ecc70a74b2058cb968a657
tree38e0cc39b71a7db53a1dfd227a8ad9a0df2b1fbe
parent71c4578def00a5a4b9e159fd1ab88e616bc7e159
Reduce PackageInstaller I/O pressure.

When performing a restore during initial device setup, we could be
installing hundreds of packages.  Currently, we're writing all
metadata (including heavy icons) for every session mutation!  Because
we're holding the mSessions lock while writing all this heavy data,
we end up causing ANRs when apps call other PackageInstaller APIs.

This patch mitigates by moving the heavy icon data into separate
per-session PNG files, which we only persist when changed.

Bug: 1788196217567794
Change-Id: I4dee15d4a65a8eb65c381e6bb7477728b6cc30d2
core/java/android/content/pm/PackageInstaller.java
core/java/com/android/internal/util/XmlUtils.java
services/core/java/com/android/server/pm/PackageInstallerService.java