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

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

Snap for 5367932 from 9c9913ff to qt-release

Change-Id: Ieeaea70107567f69ff012321f2e48c3b4700e230
parents da9ada5a 9c9913ff
Loading
Loading
Loading
Loading
+2 −16
Original line number Diff line number Diff line
@@ -270,29 +270,15 @@ struct UsbFfsConnection : public Connection {
            bool started = false;
            bool running = true;
            while (running) {
                int timeout = -1;
                if (!bound || !started) {
                    timeout = 5000 /*ms*/;
                }

                adb_pollfd pfd[2] = {
                  { .fd = control_fd_.get(), .events = POLLIN, .revents = 0 },
                  { .fd = monitor_event_fd_.get(), .events = POLLIN, .revents = 0 },
                };
                int rc = TEMP_FAILURE_RETRY(adb_poll(pfd, 2, timeout));
                int rc = TEMP_FAILURE_RETRY(adb_poll(pfd, 2, -1));
                if (rc == -1) {
                    PLOG(FATAL) << "poll on USB control fd failed";
                } else if (rc == 0) {
                    // Something in the kernel presumably went wrong.
                    // Close our endpoints, wait for a bit, and then try again.
                    StopWorker();
                    aio_context_.reset();
                    read_fd_.reset();
                    write_fd_.reset();
                    control_fd_.reset();
                    std::this_thread::sleep_for(5s);
                    HandleError("didn't receive FUNCTIONFS_ENABLE, retrying");
                    return;
                    LOG(FATAL) << "poll on USB control fd returned 0";
                }

                if (pfd[1].revents) {
+8 −1
Original line number Diff line number Diff line
@@ -41,7 +41,14 @@ std::unique_ptr<MappedFile> MappedFile::FromFd(int fd, off64_t offset, size_t le
  HANDLE handle =
      CreateFileMapping(reinterpret_cast<HANDLE>(_get_osfhandle(fd)), nullptr,
                        (prot & PROT_WRITE) ? PAGE_READWRITE : PAGE_READONLY, 0, 0, nullptr);
  if (handle == nullptr) return nullptr;
  if (handle == nullptr) {
    // http://b/119818070 "app crashes when reading asset of zero length".
    // Return a MappedFile that's only valid for reading the size.
    if (length == 0) {
      return std::unique_ptr<MappedFile>(new MappedFile{nullptr, 0, 0, nullptr});
    }
    return nullptr;
  }
  void* base = MapViewOfFile(handle, (prot & PROT_WRITE) ? FILE_MAP_ALL_ACCESS : FILE_MAP_READ, 0,
                             file_offset, file_length);
  if (base == nullptr) {
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ class MemoryFileAtOffset : public Memory {

  size_t Size() { return size_; }

  void Clear();
  void Clear() override;

 protected:
  size_t size_ = 0;