OSDN Git Service

Avoid parceling redundant ApplicationInfo objects within PackageInfo
authorChristopher Tate <ctate@google.com>
Thu, 10 Sep 2015 01:46:31 +0000 (18:46 -0700)
committerChristopher Tate <ctate@google.com>
Thu, 10 Sep 2015 21:04:01 +0000 (14:04 -0700)
commitb91167620904eb439d0e8c09eab532fe7524ff6d
tree39bed649d889d8efa6c27b5e2f10b579708e375b
parent75e38f4e75461319f18739185aee0f144f3b49ff
Avoid parceling redundant ApplicationInfo objects within PackageInfo

Two benefits:

  1) marshaling one flattened ApplicationInfo as part of a PackageInfo parcel
     rather than one per included ComponentInfo; and

  2) producing one ApplicationInfo at unmarshaling time and sharing the
     reference to it among all included ComponentInfo instances, rather
     than the previous implementation that generated a separate
     ApplicationInfo instance for each ComponentInfo.

In some cases there can be many hundreds of ComponentInfo objects embedded
in a single PackageInfo, so coalescing duplicates is a significant win
for both payload size and object pressure.

Bug 19519502
Bug 20453802

Change-Id: Ib888810dad4471084fab9ead1ebb5e0b932905f1
core/java/android/content/pm/ComponentInfo.java
core/java/android/content/pm/PackageInfo.java
core/java/android/os/Parcelable.java