mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
0ef38c0b9c
Apps targeting SDK 29 are not allowed to open /dev/ashmem directly, and instead must use NDK functions. Those functions are only available in SDK 26 and higher, so we need this shim to use the functions if they are available, else fallback to opening /dev/ashmem directly. Differential Revision: https://phabricator.services.mozilla.com/D61012 --HG-- extra : moz-landing-system : lando
23 lines
645 B
C++
23 lines
645 B
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef Ashmem_h__
|
|
#define Ashmem_h__
|
|
|
|
#include <linux/ashmem.h>
|
|
|
|
namespace mozilla {
|
|
namespace android {
|
|
|
|
// Wrappers for the ASharedMemory function in the NDK
|
|
// https://developer.android.com/ndk/reference/group/memory
|
|
MFBT_API int ashmem_create(const char* name, size_t size);
|
|
MFBT_API size_t ashmem_getSize(int fd);
|
|
MFBT_API int ashmem_setProt(int fd, int prot);
|
|
|
|
} // namespace android
|
|
} // namespace mozilla
|
|
|
|
#endif // Ashmem_h__
|