History log of /frameworks/base/core/jni/android_os_MemoryFile.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ed6b9dff563c5e22f040ff37e12c0d771e0478ae 21-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Consistency in core/jni

Make consistent use of core_jni_helpers for registration.

Translate some #ifdefs into const bools.

Change-Id: I37639aa053dd50f003a552cbd8550dddecc811c5
/frameworks/base/core/jni/android_os_MemoryFile.cpp
6ffb09171960e776466b963e51196565a033998c 16-Jan-2014 Narayan Kamath <narayan@google.com> Fix error checking in MemoryFile.

mmap returns MAP_FAILED on failures, not 0 (NULL).
Also, convert some C style casts to C++ since they
make intent clearer.

Change-Id: I367993c73e9ee576f11ebe76e530d2c2f27c662d
/frameworks/base/core/jni/android_os_MemoryFile.cpp
c20cadbdad0cdfe8e56431c22bd26ae666101e89 10-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in android/os/MemoryFile

Long is used in android/os/MemoryFile class to store
pointers as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I07afc010524c16b5c852273b89becb0c08ff27d7
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
/frameworks/base/core/jni/android_os_MemoryFile.cpp
dd66bcbf9d6ef0c50a18d9c4b1b39ce7ef7afcc4 12-Apr-2011 Elliott Hughes <enh@google.com> More native code cleanup.

Don't keep unused global references to classes, don't throw exceptions
when an exception is already pending, and fix a (harmless) misunderstanding
about how GetStringChars works.

Change-Id: Ie445036f057daa8a1c76aceb7bad2a84fb81d820
/frameworks/base/core/jni/android_os_MemoryFile.cpp
7bcbd511731e13b9f2778e6aa6c633417d266f5e 23-Jun-2009 Marco Nelissen <marcone@google.com> Don't round size to page size. Ashmem will do this internally as needed.
/frameworks/base/core/jni/android_os_MemoryFile.cpp
ec100900e63a8374ac010e7131d9c7e54c5e6984 17-Jun-2009 Marco Nelissen <marcone@google.com> MemoryFile.isMemoryFile was internally determining the length of
the ashmem region. This is actually useful information to have,
so expose that more directly.
/frameworks/base/core/jni/android_os_MemoryFile.cpp
963cd006c45716b034f656bf7e7179e6476f7e4d 29-May-2009 Bjorn Bringert <bringert@android.com> Allow creating AssetFileDescriptors for MemoryFiles.

This allows content providers to use in-memory data to implement
ContentProvider.openAssetFile(), instead of just normal files
and sockets as before.

To test cross-process use of AssetFileDescriptors for MemoryFiles,
a test content provider and a client for it are added to
AndroidTests.

Fixes http://b/issue?id=1871731
/frameworks/base/core/jni/android_os_MemoryFile.cpp
ad984f19339008f7eb8687aecc1779be70bc1f65 01-Jun-2009 Bjorn Bringert <bringert@android.com> Use JNI region calls in MemoryFile read and write.

This will reduce copying or pinning, depending on GC policies, which should
improve performance. See dalvik/docs/jni-tips.html#RegionCalls for more information.

Fixes http://b/issue?id=1887911
/frameworks/base/core/jni/android_os_MemoryFile.cpp
761e0918d30b6a3f292625b44b86dffd1538bc78 29-May-2009 Bjorn Bringert <bringert@android.com> Unmap memory in MemoryFile.close().

As reported in http://b/issue?id=1398215 MemoryFile did not
munmap(2) the ashmem region after closing it. This
causes the process to leak virtual address space.

This change fixes the problem by calling munmap(2) in
close(). The unmapping is done by a helper method deactivate().
The change also replaces the use of an int for the
file descriptor with a FileDescriptor object to
make sure that we keep track of when the file descriptor
has been closed. I chose to implement it this way because I
will need decativate() and a FileDescriptor object in an
upcoming change that allows sending MemoryFile file
descriptors between processes.

The change also adds a number of tests for the behavior
of close(). The testCloseRead() and testCloseWrite() fail
with the old MemoryFile implementation, and testCloseLeak()
causes a segfault. They all pass now.
/frameworks/base/core/jni/android_os_MemoryFile.cpp
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android_os_MemoryFile.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android_os_MemoryFile.cpp
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/jni/android_os_MemoryFile.cpp