Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f58d0fec authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by android-build-merger
Browse files

Merge "Unconditionally unlink image." am: 74a871ae

am: 85e0c9c3

Change-Id: Id90bd82b42dda93238c9b71c5045387cc9d43085
parents a386dd75 85e0c9c3
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -1139,10 +1139,9 @@ class Dex2oatFileWrapper {
// (re)Creates the app image if needed.
Dex2oatFileWrapper maybe_open_app_image(const char* out_oat_path, bool profile_guided,
        bool is_public, int uid, bool is_secondary_dex) {
    // Use app images only if it is enabled (by a set image format) and we are compiling
    // profile-guided (so the app image doesn't conservatively contain all classes).
    // Note that we don't create an image for secondary dex files.
    if (is_secondary_dex || !profile_guided) {

    // We don't create an image for secondary dex files.
    if (is_secondary_dex) {
        return Dex2oatFileWrapper();
    }

@@ -1151,6 +1150,14 @@ Dex2oatFileWrapper maybe_open_app_image(const char* out_oat_path, bool profile_g
        // Happens when the out_oat_path has an unknown extension.
        return Dex2oatFileWrapper();
    }

    // Use app images only if it is enabled (by a set image format) and we are compiling
    // profile-guided (so the app image doesn't conservatively contain all classes).
    if (!profile_guided) {
        // In case there is a stale image, remove it now. Ignore any error.
        unlink(image_path.c_str());
        return Dex2oatFileWrapper();
    }
    char app_image_format[kPropertyValueMax];
    bool have_app_image_format =
            get_property("dalvik.vm.appimageformat", app_image_format, NULL) > 0;