OSDN Git Service

Don't use profiles with vm safe mode
authorMathieu Chartier <mathieuc@google.com>
Sat, 6 Aug 2016 00:48:12 +0000 (17:48 -0700)
committerMathieu Chartier <mathieuc@google.com>
Sat, 6 Aug 2016 00:49:53 +0000 (17:49 -0700)
vm safe mode uses interpret only compiler filter, this filter will
generate a full app image if a profile is also passed down. App
image generation without a profile currently has a bug where uses
library is not pruned correctly.

Bug: 30688277

Change-Id: I60d87d698789583b8ab797eb47d031c96caf6d9b
Test: N5X boot, package compile speed-profile comb.BBClient

cmds/installd/commands.cpp

index d406179..2014e99 100644 (file)
@@ -1568,6 +1568,9 @@ int dexopt(const char* apk_path, uid_t uid, const char* pkgname, const char* ins
     bool boot_complete = (dexopt_flags & DEXOPT_BOOTCOMPLETE) != 0;
     bool profile_guided = (dexopt_flags & DEXOPT_PROFILE_GUIDED) != 0;
 
+    // Don't use profile for vm_safe_mode. b/30688277
+    profile_guided = profile_guided && !vm_safe_mode;
+
     CHECK(pkgname != nullptr);
     CHECK(pkgname[0] != 0);