OSDN Git Service

Fix package install flow w.r.t. dexopt
authorCalin Juravle <calin@google.com>
Thu, 16 Nov 2017 00:28:01 +0000 (16:28 -0800)
committerCalin Juravle <calin@google.com>
Thu, 30 Nov 2017 03:07:35 +0000 (19:07 -0800)
commitc6540daf8388ce1ebd2e4157ec70b9651ae14b4f
tree6b39d762cd68c863d57421d8facf9f149f7bb8e6
parent3b1b282528c5b1565e28112aab7e49eff63e4770
Fix package install flow w.r.t. dexopt

Calling dexopt before the applicationInfo gets the uid is wrong.
Dexopt needs to be able to set the GID of the odex file to the
UserHandle.getSharedAppGid(pkg.applicationInfo.uid) and that is
possible only with a valid uid.

Move the dexopt logic after installNewPackageLIF/replacePackageLIF
to ensure that we get a valid uid.

Bug: 69331247
Test: adb install & check the GID of the compiler artifacts
Change-Id: I2434a1a0b9015091a9af2009b3f785b7a16e1256
services/core/java/com/android/server/pm/PackageDexOptimizer.java
services/core/java/com/android/server/pm/PackageManagerService.java