summaryrefslogtreecommitdiff
path: root/core/java/android/net/LocalSocketImpl.java
diff options
context:
space:
mode:
authorChristian Wailes <chriswailes@google.com>2019-09-04 23:35:54 +0000
committerChristian Wailes <chriswailes@google.com>2019-09-04 23:37:32 +0000
commit647fee87dc9524554707deecd94d0cca2933f3bf (patch)
tree4c5043d815af9c68292f77d28126bd7ab4e2a29d /core/java/android/net/LocalSocketImpl.java
parent47da17740520f3d6ba952c65593f8660b89b8abf (diff)
Revert "Revert "Remove a misleading "flush" function.""
This reverts commit 47da17740520f3d6ba952c65593f8660b89b8abf. Reason for revert: Fixed the test broken by the original commit Bug: 139192244 Bug: 140336855 Test: m -> flash -> boot Test: atest CtsJvmtiAttachingHostTestCases Change-Id: I4c67ad8709652c4710ef24564e0240f74f817f8c
Diffstat (limited to 'core/java/android/net/LocalSocketImpl.java')
-rw-r--r--core/java/android/net/LocalSocketImpl.java34
1 files changed, 0 insertions, 34 deletions
diff --git a/core/java/android/net/LocalSocketImpl.java b/core/java/android/net/LocalSocketImpl.java
index fe7632c25445..b066a15106af 100644
--- a/core/java/android/net/LocalSocketImpl.java
+++ b/core/java/android/net/LocalSocketImpl.java
@@ -157,40 +157,6 @@ class LocalSocketImpl
write_native(b, myFd);
}
}
-
- /**
- * Wait until the data in sending queue is emptied. A polling version
- * for flush implementation.
- * @throws IOException
- * if an i/o error occurs.
- */
- @Override
- public void flush() throws IOException {
- FileDescriptor myFd = fd;
- if (myFd == null) throw new IOException("socket closed");
-
- // Loop until the output buffer is empty.
- Int32Ref pending = new Int32Ref(0);
- while (true) {
- try {
- // See linux/net/unix/af_unix.c
- Os.ioctlInt(myFd, OsConstants.TIOCOUTQ, pending);
- } catch (ErrnoException e) {
- throw e.rethrowAsIOException();
- }
-
- if (pending.value <= 0) {
- // The output buffer is empty.
- break;
- }
-
- try {
- Thread.sleep(10);
- } catch (InterruptedException ie) {
- break;
- }
- }
- }
}
private native int read_native(FileDescriptor fd) throws IOException;