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

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

Snap for 4533842 from 6e15dfc0 to pi-release

Change-Id: Ie6288d61929d68d297882b1647c46f887959f975
parents b1848e00 6e15dfc0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@

#include <atomic>
#include <chrono>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <string>
+11 −3
Original line number Diff line number Diff line
@@ -952,10 +952,18 @@ static void append_transport(const atransport* t, std::string* result, bool long
}

std::string list_transports(bool long_listing) {
    std::string result;

    std::lock_guard<std::recursive_mutex> lock(transport_lock);
    for (const auto& t : transport_list) {

    auto sorted_transport_list = transport_list;
    sorted_transport_list.sort([](atransport*& x, atransport*& y) {
        if (x->type != y->type) {
            return x->type < y->type;
        }
        return strcmp(x->serial, y->serial) < 0;
    });

    std::string result;
    for (const auto& t : sorted_transport_list) {
        append_transport(t, &result, long_listing);
    }
    return result;
+1 −1
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@ noinline int do_action(const char* arg) {
        munmap(map, sizeof(int));
        map[0] = '8';
    } else if (!strcasecmp(arg, "seccomp")) {
        set_seccomp_filter();
        set_system_seccomp_filter();
        syscall(99999);
#if defined(__arm__)
    } else if (!strcasecmp(arg, "kuser_helper_version")) {
+7 −5
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/unique_fd.h>
#include <cutils/android_filesystem_config.h>
#include <cutils/android_reboot.h>
#include <cutils/partition_utils.h>
#include <cutils/properties.h>
@@ -353,7 +354,7 @@ static void tune_reserved_size(const char* blk_device, const struct fstab_rec* r
        reserved_blocks = max_reserved_blocks;
    }

    if (ext4_r_blocks_count(sb) == reserved_blocks) {
    if ((ext4_r_blocks_count(sb) == reserved_blocks) && (sb->s_def_resgid == AID_RESERVED_DISK)) {
        return;
    }

@@ -363,11 +364,12 @@ static void tune_reserved_size(const char* blk_device, const struct fstab_rec* r
        return;
    }

    char buf[32];
    const char* argv[] = {TUNE2FS_BIN, "-r", buf, blk_device};

    snprintf(buf, sizeof(buf), "%" PRIu64, reserved_blocks);
    LINFO << "Setting reserved block count on " << blk_device << " to " << reserved_blocks;

    auto reserved_blocks_str = std::to_string(reserved_blocks);
    auto reserved_gid_str = std::to_string(AID_RESERVED_DISK);
    const char* argv[] = {
        TUNE2FS_BIN, "-r", reserved_blocks_str.c_str(), "-g", reserved_gid_str.c_str(), blk_device};
    if (!run_tune2fs(argv, ARRAY_SIZE(argv))) {
        LERROR << "Failed to run " TUNE2FS_BIN " to set the number of reserved blocks on "
               << blk_device;
+12 −8
Original line number Diff line number Diff line
@@ -638,6 +638,7 @@ err:
 * frees up memory of the return value without touching a and b. */
static struct fstab *in_place_merge(struct fstab *a, struct fstab *b)
{
    if (!a && !b) return nullptr;
    if (!a) return b;
    if (!b) return a;

@@ -654,12 +655,13 @@ static struct fstab *in_place_merge(struct fstab *a, struct fstab *b)
    }

    for (int i = a->num_entries, j = 0; i < total_entries; i++, j++) {
        // copy the pointer directly *without* malloc and memcpy
        // Copy the structs by assignment.
        a->recs[i] = b->recs[j];
    }

    // Frees up b, but don't free b->recs[X] to make sure they are
    // accessible through a->recs[X].
    // We can't call fs_mgr_free_fstab because a->recs still references the
    // memory allocated by strdup.
    free(b->recs);
    free(b->fstab_filename);
    free(b);

@@ -754,15 +756,17 @@ struct fstab *fs_mgr_read_fstab_default()
        default_fstab = get_fstab_path();
    }

    if (default_fstab.empty()) {
        LWARNING << __FUNCTION__ << "(): failed to find device default fstab";
    struct fstab* fstab = nullptr;
    if (!default_fstab.empty()) {
        fstab = fs_mgr_read_fstab(default_fstab.c_str());
    } else {
        LINFO << __FUNCTION__ << "(): failed to find device default fstab";
    }

    // combines fstab entries passed in from device tree with
    // the ones found from default_fstab file
    struct fstab* fstab_dt = fs_mgr_read_fstab_dt();
    struct fstab *fstab = fs_mgr_read_fstab(default_fstab.c_str());

    // combines fstab entries passed in from device tree with
    // the ones found from default_fstab file
    return in_place_merge(fstab_dt, fstab);
}

Loading