forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
third_party/ashmem: Use ASharedMemory_create() et al.
This CL modifies the implementation of third_party/ashmem/ to use the ASharedMemory function provided by libandroid.so when possible (i.e. starting with API level 26). This is in preparation for the future removal of the Ashmem device from Android. The libandroid functions will provide working alternatives, but pin/unpin will probably not work anymore. The current code will try to use Ashmem ioctls whenever possible, i.e.: - Perform runtime probing to determine the system's current API level. - If API level is below 26, do not change the way regions are created / managed through the Ashmem device file and ioctls. - If API level is 26 or above, exclusively use the libandroid functions related to ASharedMemory to create / size / protect regions. Even if this currently wraps ashmem device open() and ioctls(), this may change in a future Android release but these APIs will keep working as intended. - If API level is 26 or above, try to detect that the Ashmem device is available, and if so, continue performing pin / unpin on it. If this is not the case, these operations become no-ops. NOTE: A CL was uploaded to disable this explicitly by faking a non-Ashmem device to verify that this didn't break our unit tests. See patchset 8 at [1] + Remove ashmem_purge_all(), since it was unused. + Add ashmem_device_is_supported() since this must be surfaced to avoid breaking one unit-test that checks for explicit behaviour that cannot be supported in the future. [1] https://chromium-review.googlesource.com/c/chromium/src/+/1450259/8 BUG=914650 R=lizeb@chromium.org Change-Id: Iffee23bf8bad8b68a3efdb2208c0a9494432731b Reviewed-on: https://chromium-review.googlesource.com/c/1454628 Commit-Queue: David Turner <digit@chromium.org> Reviewed-by: Benoit L <lizeb@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Cr-Commit-Position: refs/heads/master@{#629603}
- Loading branch information
1 parent
648d903
commit cf4ac42
Showing
7 changed files
with
584 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.