Use OpenJdk implementation of java.nio.channels.{spi}.*
- Unsafe : Add supporting methods (addressSize, pageSize,
allocateMemory, freeMemory, setMemory and various getters
equivalent to the existing libcore Memory classes).
- NioUtils : Rewrite nioutils methods in terms of OpenJdk classes.
- DeleteOnExitHook : Access java.lang.Shutdown directly.
- FileDescriptor : Add getInt$, setInt$ and setSocket.
- NativeBuffers : Copy byte-by-byte instead of using Unsafe.copyMemory.
- FileInputStream : Add a custom implementation of available() instead
of using IO_Available.
General : Switch JNI code to explicit registration rather than
implicit registration.
General : Track renaming of Unsafe methods (to add the $ suffix). This
might be unnecessary and will be reverted in a future change.
Change-Id: I7e63340d266dbd4b1c425b13710c05dce1086d4b
diff --git a/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java
index 4777f97..9ac1220 100755
--- a/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java
+++ b/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java
@@ -47,7 +47,8 @@
private final FileDispatcher nd;
// File descriptor
- private final FileDescriptor fd;
+ // Android-changed: make public.
+ public final FileDescriptor fd;
// File access mode (immutable)
private final boolean writable;
@@ -920,35 +921,8 @@
}
}
- /**
- * Invoked by sun.management.ManagementFactoryHelper to create the management
- * interface for mapped buffers.
- */
- public static sun.misc.JavaNioAccess.BufferPool getMappedBufferPool() {
- return new sun.misc.JavaNioAccess.BufferPool() {
- @Override
- public String getName() {
- return "mapped";
- }
- @Override
- public long getCount() {
- return Unmapper.count;
- }
- @Override
- public long getTotalCapacity() {
- return Unmapper.totalCapacity;
- }
- @Override
- public long getMemoryUsed() {
- return Unmapper.totalSize;
- }
- };
- }
-
// -- Locks --
-
-
// keeps track of locks on this file
private volatile FileLockTable fileLockTable;