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

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

Snap for 11355999 from eeeddf10 to 24Q2-release

Change-Id: I34346c8f00c86d431301dbfeac83de68c05bdce6
parents 91ca319e eeeddf10
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -532,6 +532,30 @@ int Looper::removeFd(int fd) {
    return removeSequenceNumberLocked(it->second);
}

int Looper::repoll(int fd) {
    AutoMutex _l(mLock);
    const auto& it = mSequenceNumberByFd.find(fd);
    if (it == mSequenceNumberByFd.end()) {
        return 0;
    }

    const auto& request_it = mRequests.find(it->second);
    if (request_it == mRequests.end()) {
        return 0;
    }
    const auto& [seq, request] = *request_it;

    LOG_ALWAYS_FATAL_IF(
            fd != request.fd,
            "Looper has inconsistent data structure. When looking up FD %d found FD %d.", fd,
            request_it->second.fd);

    epoll_event eventItem = createEpollEvent(request.getEpollEvents(), seq);
    if (epoll_ctl(mEpollFd.get(), EPOLL_CTL_MOD, fd, &eventItem) == -1) return 0;

    return 1;  // success
}

int Looper::removeSequenceNumberLocked(SequenceNumber seq) {
#if DEBUG_CALLBACKS
    ALOGD("%p ~ removeFd - seq=%" PRIu64, this, seq);
+12 −0
Original line number Diff line number Diff line
@@ -344,6 +344,18 @@ public:
     */
    int removeFd(int fd);

    /**
     * Tell the kernel to check for the same events we're already checking for
     * with this FD. This is to be used when there is a kernel driver bug where
     * the kernel does not properly mark itself as having new data available, in
     * order to force "fd_op->poll()" to be called. You probably don't want to
     * use this in general, and you shouldn't use it unless there is a plan to
     * fix the kernel. See also b/296817256.
     *
     * Returns 1 if successfully repolled, 0 if not.
     */
    int repoll(int fd);

    /**
     * Enqueues a message to be processed by the specified handler.
     *
+3 −0
Original line number Diff line number Diff line
@@ -109,6 +109,9 @@ on init
    symlink /proc/self/fd/1 /dev/stdout
    symlink /proc/self/fd/2 /dev/stderr

    # Create socket dir for ot-daemon
    mkdir /dev/socket/ot-daemon 0770 thread_network thread_network

    # Create energy-aware scheduler tuning nodes
    mkdir /dev/stune/foreground
    mkdir /dev/stune/background