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

Commit d5eddddf authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-224b654d-e3ad-4f05-a95d-d10d1516b3f6-for-git_oc-release-407562...

release-request-224b654d-e3ad-4f05-a95d-d10d1516b3f6-for-git_oc-release-4075622 snap-temp-L17600000071371496

Change-Id: If50c56c2979f6db98db5ebcd0c6f0e43bae17da0
parents 3039b505 9351f720
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -444,8 +444,11 @@ static bool setTraceBufferSizeKB(int size)
// Set the default size of cmdline hashtable
static bool setCmdlineSize()
{
    if (fileExists(k_traceCmdlineSizePath)) {
        return writeStr(k_traceCmdlineSizePath, "8192");
    }
    return true;
}

// Set the clock to the best available option while tracing. Use 'boot' if it's
// available; otherwise, use 'mono'. If neither are available use 'global'.
+4 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ on post-fs
    chown root shell /sys/kernel/tracing/options/overwrite
    chown root shell /sys/kernel/debug/tracing/options/print-tgid
    chown root shell /sys/kernel/tracing/options/print-tgid
    chown root shell /sys/kernel/debug/tracing/options/saved_cmdlines_size
    chown root shell /sys/kernel/tracing/options/saved_cmdlines_size
    chown root shell /sys/kernel/debug/tracing/events/sched/sched_switch/enable
    chown root shell /sys/kernel/tracing/events/sched/sched_switch/enable
    chown root shell /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable
@@ -63,6 +65,8 @@ on post-fs
    chmod 0664 /sys/kernel/tracing/options/overwrite
    chmod 0664 /sys/kernel/debug/tracing/options/print-tgid
    chmod 0664 /sys/kernel/tracing/options/print-tgid
    chmod 0664 /sys/kernel/debug/tracing/options/saved_cmdlines_size
    chmod 0664 /sys/kernel/tracing/options/saved_cmdlines_size
    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_switch/enable
    chmod 0664 /sys/kernel/tracing/events/sched/sched_switch/enable
    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable
+50 −15
Original line number Diff line number Diff line
@@ -1154,7 +1154,7 @@ Dex2oatFileWrapper maybe_open_reference_profile(const std::string& pkgname,
// out_vdex_wrapper_fd. Returns true for success or false in case of errors.
bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_needed,
        const char* instruction_set, bool is_public, int uid, bool is_secondary_dex,
        Dex2oatFileWrapper* in_vdex_wrapper_fd,
        bool profile_guided, Dex2oatFileWrapper* in_vdex_wrapper_fd,
        Dex2oatFileWrapper* out_vdex_wrapper_fd) {
    CHECK(in_vdex_wrapper_fd != nullptr);
    CHECK(out_vdex_wrapper_fd != nullptr);
@@ -1164,6 +1164,14 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_
    int dexopt_action = abs(dexopt_needed);
    bool is_odex_location = dexopt_needed < 0;
    std::string in_vdex_path_str;

    // Infer the name of the output VDEX.
    const std::string out_vdex_path_str = create_vdex_filename(out_oat_path);
    if (out_vdex_path_str.empty()) {
        return false;
    }

    bool update_vdex_in_place = false;
    if (dexopt_action != DEX2OAT_FROM_SCRATCH) {
        // Open the possibly existing vdex. If none exist, we pass -1 to dex2oat for input-vdex-fd.
        const char* path = nullptr;
@@ -1182,15 +1190,41 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_
            ALOGE("installd cannot compute input vdex location for '%s'\n", path);
            return false;
        }
        // We can update in place when all these conditions are met:
        // 1) The vdex location to write to is the same as the vdex location to read (vdex files
        //    on /system typically cannot be updated in place).
        // 2) We dex2oat due to boot image change, because we then know the existing vdex file
        //    cannot be currently used by a running process.
        // 3) We are not doing a profile guided compilation, because dexlayout requires two
        //    different vdex files to operate.
        update_vdex_in_place =
            (in_vdex_path_str == out_vdex_path_str) &&
            (dexopt_action == DEX2OAT_FOR_BOOT_IMAGE) &&
            !profile_guided;
        if (update_vdex_in_place) {
            // Open the file read-write to be able to update it.
            in_vdex_wrapper_fd->reset(open(in_vdex_path_str.c_str(), O_RDWR, 0));
            if (in_vdex_wrapper_fd->get() == -1) {
                // If we failed to open the file, we cannot update it in place.
                update_vdex_in_place = false;
            }
        } else {
            in_vdex_wrapper_fd->reset(open(in_vdex_path_str.c_str(), O_RDONLY, 0));
        }

    // Infer the name of the output VDEX and create it.
    const std::string out_vdex_path_str = create_vdex_filename(out_oat_path);
    if (out_vdex_path_str.empty()) {
        return false;
    }

    // If we are updating the vdex in place, we do not need to recreate a vdex,
    // and can use the same existing one.
    if (update_vdex_in_place) {
        // We unlink the file in case the invocation of dex2oat fails, to ensure we don't
        // have bogus stale vdex files.
        out_vdex_wrapper_fd->reset(
              in_vdex_wrapper_fd->get(),
              [out_vdex_path_str]() { unlink(out_vdex_path_str.c_str()); });
        // Disable auto close for the in wrapper fd (it will be done when destructing the out
        // wrapper).
        in_vdex_wrapper_fd->DisableAutoClose();
    } else {
        out_vdex_wrapper_fd->reset(
              open_output_file(out_vdex_path_str.c_str(), /*recreate*/true, /*permissions*/0644),
              [out_vdex_path_str]() { unlink(out_vdex_path_str.c_str()); });
@@ -1198,6 +1232,7 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_
            ALOGE("installd cannot open vdex'%s' during dexopt\n", out_vdex_path_str.c_str());
            return false;
        }
    }
    if (!set_permissions_and_ownership(out_vdex_wrapper_fd->get(), is_public, uid,
            out_vdex_path_str.c_str(), is_secondary_dex)) {
        ALOGE("installd cannot set owner '%s' for vdex during dexopt\n", out_vdex_path_str.c_str());
@@ -1508,7 +1543,7 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins
    Dex2oatFileWrapper in_vdex_fd;
    Dex2oatFileWrapper out_vdex_fd;
    if (!open_vdex_files(dex_path, out_oat_path, dexopt_needed, instruction_set, is_public, uid,
            is_secondary_dex, &in_vdex_fd, &out_vdex_fd)) {
            is_secondary_dex, profile_guided, &in_vdex_fd, &out_vdex_fd)) {
        return -1;
    }

+8 −0
Original line number Diff line number Diff line
@@ -2523,6 +2523,14 @@ bool Layer::getTransformToDisplayInverse() const {
    return mSurfaceFlingerConsumer->getTransformToDisplayInverse();
}

size_t Layer::getChildrenCount() const {
    size_t count = 0;
    for (const sp<Layer>& child : mCurrentChildren) {
        count += 1 + child->getChildrenCount();
    }
    return count;
}

void Layer::addChild(const sp<Layer>& layer) {
    mCurrentChildren.add(layer);
    layer->setParent(this);
+1 −0
Original line number Diff line number Diff line
@@ -519,6 +519,7 @@ public:
                                 const LayerVector::Visitor& visitor);
    void traverseInZOrder(LayerVector::StateSet stateSet, const LayerVector::Visitor& visitor);

    size_t getChildrenCount() const;
    void addChild(const sp<Layer>& layer);
    // Returns index if removed, or negative value otherwise
    // for symmetry with Vector::remove
Loading