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

Commit a9726baf authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12327203 from db3edfa7 to 24Q4-release

Change-Id: I584a51c16969d8fb786d0445a04e3661db12bee6
parents 038f82e5 db3edfa7
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -116,8 +116,7 @@ bool StreamInPrimary::useStubStream(const AudioDevice& device) {
            GetBoolProperty("ro.boot.audio.tinyalsa.simulate_input", false);
    return kSimulateInput || device.type.type == AudioDeviceType::IN_TELEPHONY_RX ||
           device.type.type == AudioDeviceType::IN_FM_TUNER ||
           device.type.connection == AudioDeviceDescription::CONNECTION_BUS /*deprecated */ ||
           (device.type.type == AudioDeviceType::IN_BUS && device.type.connection.empty());
           device.type.connection == AudioDeviceDescription::CONNECTION_BUS /*deprecated */;
}

StreamSwitcher::DeviceSwitchBehavior StreamInPrimary::switchCurrentStream(
@@ -188,8 +187,7 @@ bool StreamOutPrimary::useStubStream(const AudioDevice& device) {
    static const bool kSimulateOutput =
            GetBoolProperty("ro.boot.audio.tinyalsa.ignore_output", false);
    return kSimulateOutput || device.type.type == AudioDeviceType::OUT_TELEPHONY_TX ||
           device.type.connection == AudioDeviceDescription::CONNECTION_BUS /*deprecated*/ ||
           (device.type.type == AudioDeviceType::OUT_BUS && device.type.connection.empty());
           device.type.connection == AudioDeviceDescription::CONNECTION_BUS /*deprecated*/;
}

StreamSwitcher::DeviceSwitchBehavior StreamOutPrimary::switchCurrentStream(
+9 −2
Original line number Diff line number Diff line
@@ -51,15 +51,22 @@ cc_defaults {
cc_binary {
    name: "android.hardware.automotive.remoteaccess@V2-default-service",
    defaults: ["remote-access-hal-defaults"],
    vintf_fragments: ["remoteaccess-default-service.xml"],
    init_rc: ["remoteaccess-default-service.rc"],
    vintf_fragment_modules: ["remoteaccess-default-service.xml"],

}

cc_binary {
    name: "android.hardware.automotive.remoteaccess@V2-tcu-test-service",
    defaults: ["remote-access-hal-defaults"],
    vintf_fragments: ["remoteaccess-default-service.xml"],
    init_rc: ["remoteaccess-tcu-test-service.rc"],
    vintf_fragment_modules: ["remoteaccess-default-service.xml"],
}

vintf_fragment {
    name: "remoteaccess-default-service.xml",
    src: "remoteaccess-default-service.xml",
    vendor: true,
}

cc_library {
+41 −30
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ namespace android {
namespace hardware {
namespace health {

static constexpr uint32_t kUeventMsgLen = 2048;

HealthLoop::HealthLoop() {
    InitHealthdConfig(&healthd_config_);
    awake_poll_interval_ = -1;
@@ -61,14 +63,13 @@ int HealthLoop::RegisterEvent(int fd, BoundFunction func, EventWakeup wakeup) {
                                          EventHandler{this, fd, std::move(func)}))
                                  .get();

    struct epoll_event ev;

    ev.events = EPOLLIN;
    struct epoll_event ev = {
        .events = EPOLLIN | EPOLLERR,
        .data.ptr = reinterpret_cast<void*>(event_handler),
    };

    if (wakeup == EVENT_WAKEUP_FD) ev.events |= EPOLLWAKEUP;

    ev.data.ptr = reinterpret_cast<void*>(event_handler);

    if (epoll_ctl(epollfd_, EPOLL_CTL_ADD, fd, &ev) == -1) {
        KLOG_ERROR(LOG_TAG, "epoll_ctl failed; errno=%d\n", errno);
        return -1;
@@ -121,32 +122,42 @@ void HealthLoop::PeriodicChores() {
    ScheduleBatteryUpdate();
}

#define UEVENT_MSG_LEN 2048
void HealthLoop::UeventEvent(uint32_t /*epevents*/) {
    // No need to lock because uevent_fd_ is guaranteed to be initialized.

    char msg[UEVENT_MSG_LEN + 2];
    char* cp;
    int n;

    n = uevent_kernel_multicast_recv(uevent_fd_, msg, UEVENT_MSG_LEN);
    if (n <= 0) return;
    if (n >= UEVENT_MSG_LEN) /* overflow -- discard */
        return;
// Returns true if and only if the battery statistics should be updated.
bool HealthLoop::RecvUevents() {
    bool update_stats = false;
    for (;;) {
        char msg[kUeventMsgLen + 2];
        int n = uevent_kernel_multicast_recv(uevent_fd_, msg, kUeventMsgLen);
        if (n < 0 && errno == ENOBUFS) {
            update_stats = true;
        }
        if (n <= 0) return update_stats;
        if (n >= kUeventMsgLen) {
            // too long -- discard
            continue;
        }
        if (update_stats) {
            continue;
        }

        msg[n] = '\0';
        msg[n + 1] = '\0';
    cp = msg;

    while (*cp) {
        if (!strcmp(cp, "SUBSYSTEM=power_supply")) {
            ScheduleBatteryUpdate();
        for (char* cp = msg; *cp;) {
            if (strcmp(cp, "SUBSYSTEM=power_supply") == 0) {
                update_stats = true;
                break;
            }

            /* advance to after the next \0 */
        while (*cp++)
            ;
            while (*cp++) {
            }
        }
    }
}

void HealthLoop::UeventEvent(uint32_t /*epevents*/) {
    if (RecvUevents()) {
        ScheduleBatteryUpdate();
    }
}

@@ -169,7 +180,7 @@ Result<void> HealthLoop::AttachFilter(int uevent_fd) {
}

void HealthLoop::UeventInit(void) {
    uevent_fd_.reset(uevent_create_socket(64 * 1024, true));
    uevent_fd_.reset(uevent_create_socket(kUeventMsgLen, true));

    if (uevent_fd_ < 0) {
        KLOG_ERROR(LOG_TAG, "uevent_init: uevent_open_socket failed\n");
@@ -183,9 +194,9 @@ void HealthLoop::UeventInit(void) {
        std::string error_msg = attach_result.error().message();
        error_msg +=
                ". This is expected in recovery mode and also for kernel versions before 5.10.";
        KLOG_WARNING(LOG_TAG, "%s", error_msg.c_str());
        KLOG_WARNING(LOG_TAG, "%s\n", error_msg.c_str());
    } else {
        KLOG_INFO(LOG_TAG, "Successfully attached the BPF filter to the uevent socket");
        KLOG_INFO(LOG_TAG, "Successfully attached the BPF filter to the uevent socket\n");
    }

    if (RegisterEvent(uevent_fd_, &HealthLoop::UeventEvent, EVENT_WAKEUP_FD))
+1 −0
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ class HealthLoop {
    void WakeAlarmInit();
    void WakeAlarmEvent(uint32_t);
    void UeventInit();
    bool RecvUevents();
    void UeventEvent(uint32_t);
    void WakeAlarmSetInterval(int interval);
    void PeriodicChores();
+28 −10
Original line number Diff line number Diff line
@@ -7,6 +7,24 @@ package {
    default_applicable_licenses: ["hardware_interfaces_license"],
}

vintf_fragment {
    name: "android.hardware.security.keymint-service.xml",
    src: "android.hardware.security.keymint-service.xml",
    vendor: true,
}

vintf_fragment {
    name: "android.hardware.security.sharedsecret-service.xml",
    src: "android.hardware.security.sharedsecret-service.xml",
    vendor: true,
}

vintf_fragment {
    name: "android.hardware.security.secureclock-service.xml",
    src: "android.hardware.security.secureclock-service.xml",
    vendor: true,
}

// The following target has an insecure implementation of KeyMint where the
// trusted application (TA) code runs in-process alongside the HAL service
// code.
@@ -18,11 +36,6 @@ cc_binary {
    name: "android.hardware.security.keymint-service",
    relative_install_path: "hw",
    init_rc: ["android.hardware.security.keymint-service.rc"],
    vintf_fragments: [
        "android.hardware.security.keymint-service.xml",
        "android.hardware.security.sharedsecret-service.xml",
        "android.hardware.security.secureclock-service.xml",
    ],
    vendor: true,
    cflags: [
        "-Wall",
@@ -51,6 +64,11 @@ cc_binary {
    required: [
        "android.hardware.hardware_keystore.xml",
    ],
    vintf_fragment_modules: [
        "android.hardware.security.keymint-service.xml",
        "android.hardware.security.sharedsecret-service.xml",
        "android.hardware.security.secureclock-service.xml",
    ],
}

// The following target has an insecure implementation of KeyMint where the
@@ -65,11 +83,6 @@ rust_binary {
    relative_install_path: "hw",
    vendor: true,
    init_rc: ["android.hardware.security.keymint-service.nonsecure.rc"],
    vintf_fragments: [
        "android.hardware.security.keymint-service.xml",
        "android.hardware.security.sharedsecret-service.xml",
        "android.hardware.security.secureclock-service.xml",
    ],
    defaults: [
        "keymint_use_latest_hal_aidl_rust",
    ],
@@ -87,6 +100,11 @@ rust_binary {
    required: [
        "android.hardware.hardware_keystore.xml",
    ],
    vintf_fragment_modules: [
        "android.hardware.security.keymint-service.xml",
        "android.hardware.security.sharedsecret-service.xml",
        "android.hardware.security.secureclock-service.xml",
    ],
}

prebuilt_etc {
Loading