summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christian Wailes <chriswailes@google.com> 2019-08-30 16:24:39 -0700
committer android-build-merger <android-build-merger@google.com> 2019-08-30 16:24:39 -0700
commit932b360d45f008b57d02066634c0140a24f6fdd2 (patch)
treeae9511a6e6ad481df153a4b34d355c508c6f4fa6
parent4da29523423865cfcf97c6ace735f0c410f46517 (diff)
parentd6f04e744dc23a6ef13179751838d147500da04b (diff)
Merge "Remove a misleading "flush" function."
am: d6f04e744d Change-Id: I31a2c6a8b49493ea85816071874c3e08841f233f
-rw-r--r--core/java/android/bluetooth/BluetoothOutputStream.java12
-rw-r--r--core/java/android/bluetooth/BluetoothSocket.java14
-rw-r--r--core/java/android/net/LocalSocketImpl.java34
-rw-r--r--services/core/java/com/android/server/RecoverySystemService.java4
-rw-r--r--services/core/java/com/android/server/connectivity/Vpn.java1
5 files changed, 0 insertions, 65 deletions
diff --git a/core/java/android/bluetooth/BluetoothOutputStream.java b/core/java/android/bluetooth/BluetoothOutputStream.java
index dfec4e102fd4..a0aa2dee9d34 100644
--- a/core/java/android/bluetooth/BluetoothOutputStream.java
+++ b/core/java/android/bluetooth/BluetoothOutputStream.java
@@ -75,16 +75,4 @@ import java.io.OutputStream;
}
mSocket.write(b, offset, count);
}
-
- /**
- * Wait until the data in sending queue is emptied. A polling version
- * for flush implementation. Use it to ensure the writing data afterwards will
- * be packed in the new RFCOMM frame.
- *
- * @throws IOException if an i/o error occurs.
- * @since Android 4.2.3
- */
- public void flush() throws IOException {
- mSocket.flush();
- }
}
diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java
index a6e3153d6af7..760166bfcc5d 100644
--- a/core/java/android/bluetooth/BluetoothSocket.java
+++ b/core/java/android/bluetooth/BluetoothSocket.java
@@ -515,20 +515,6 @@ public final class BluetoothSocket implements Closeable {
return mSocketIS.available();
}
- /**
- * Wait until the data in sending queue is emptied. A polling version
- * for flush implementation. Used to ensure the writing data afterwards will
- * be packed in new RFCOMM frame.
- *
- * @throws IOException if an i/o error occurs.
- */
- @UnsupportedAppUsage
- /*package*/ void flush() throws IOException {
- if (mSocketOS == null) throw new IOException("flush is called on null OutputStream");
- if (VDBG) Log.d(TAG, "flush: " + mSocketOS);
- mSocketOS.flush();
- }
-
/*package*/ int read(byte[] b, int offset, int length) throws IOException {
int ret = 0;
if (VDBG) Log.d(TAG, "read in: " + mSocketIS + " len: " + length);
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;
diff --git a/services/core/java/com/android/server/RecoverySystemService.java b/services/core/java/com/android/server/RecoverySystemService.java
index 1517887efec2..997178e1582b 100644
--- a/services/core/java/com/android/server/RecoverySystemService.java
+++ b/services/core/java/com/android/server/RecoverySystemService.java
@@ -25,15 +25,12 @@ import android.os.PowerManager;
import android.os.RecoverySystem;
import android.os.RemoteException;
import android.os.SystemProperties;
-import android.system.ErrnoException;
-import android.system.Os;
import android.util.Slog;
import libcore.io.IoUtils;
import java.io.DataInputStream;
import java.io.DataOutputStream;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -288,7 +285,6 @@ public final class RecoverySystemService extends SystemService {
byte[] cmdUtf8 = command.getBytes("UTF-8");
dos.writeInt(cmdUtf8.length);
dos.write(cmdUtf8, 0, cmdUtf8.length);
- dos.flush();
}
// Read the status from the socket.
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index 1bd29e51b8e2..063ad75fe7e2 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -2082,7 +2082,6 @@ public class Vpn {
}
out.write(0xFF);
out.write(0xFF);
- out.flush();
// Wait for End-of-File.
InputStream in = mSockets[i].getInputStream();