pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/flutter/flutter/pull/174731

437.css" /> Made emulator check more thorough by gaaclarke · Pull Request #174731 · flutter/flutter · GitHub
Skip to content

Conversation

gaaclarke
Copy link
Member

fixes #169931

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@gaaclarke gaaclarke requested a review from a team as a code owner August 29, 2025 21:13
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine repository. See also e: labels. team-android Owned by Android platform team labels Aug 29, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the emulator detection logic by making the check in IsDeviceEmulator more comprehensive. The updated function now inspects the ro.hardware system property for common emulator values and checks for the existence of /dev/qemu_pipe, in addition to the existing check for "gphone" in ro.product.model. The function's signature has been simplified, and call sites have been updated. My review includes a suggestion to use the non-throwing version of std::filesystem::exists to prevent potential application crashes, as exceptions are disabled in the Flutter engine.

@gaaclarke gaaclarke requested review from chinmaygarde and flar August 29, 2025 21:15
…mic_impeller.cc

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
}

std::error_code ec;
if (fs::exists("/dev/qemu_pipe", ec)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets stick to fml::IsFile instead? Handles stuff like directories and you won't have to pull in to boot.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exists seems more apropos to me. It is a weird file and I didn't want to try to figure out if has weird stat results. I could see it being a symbolic link in some cases 🤷

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess thats precisely why I'd rather use our utilities. I don't know how std::filesystem::exists is implemented. Does it check for sockets, block devices, links? Or should we instead use ::faccessat and friends. I can look that up in FML. Reading the docs on std::filesystem and they are more handwavy.

Honestly, if you want to just make sure to check for access bool exists = ::access(path, F_OK) == 0; should help you cast the widest net. This bit in the docs make me worry that it won't consider sockets or block devices and you'll miss something: path corresponds to an existing file or directory

A secondary concern is just different places using different utilities to do the same thing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, I don't want you to spend time figuring out what type of a file/block-device/fifo, etc. it is and I don't trust std::filesystem and its docs to tell me exactly what it checks for. ::access seems like a good 🤷🏽 approach.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, sounds good. Moved to access with F_OK. I ssh'd into the emulator and fwiw that file was a symbolic link on my emulator. I would expect std::filesystem::exists to return true for a symbolic link, but happy to just do it this way.

@gaaclarke gaaclarke requested a review from chinmaygarde August 29, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine flutter/engine repository. See also e: labels. platform-android Android applications specifically team-android Owned by Android platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flutter 3.32 Android Emulator running Vulkan rendering flickers with impeller
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy