diff options
| author | 2019-11-25 12:12:22 -0800 | |
|---|---|---|
| committer | 2019-11-25 12:12:22 -0800 | |
| commit | 9f134c576b6ff856d052f860c22b45df40e36266 (patch) | |
| tree | d6f036453dc9ffceb06e973185ea52a28a09862a | |
| parent | c4755ff9a0c828351467fdf8692a0c797eefd4d4 (diff) | |
| parent | f53321435277664ec179715faa7341f059d35c0a (diff) | |
Merge "RecoverySystem: do not check if socket is closed" am: 6cc2ca0b82
am: f533214352
Change-Id: I876167c5501302dfa791f01f7d9493d503ccfbef
| -rw-r--r-- | services/core/java/com/android/server/recoverysystem/RecoverySystemService.java | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java b/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java index fe18fbf2a782..fdb14be6b1a4 100644 --- a/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java +++ b/services/core/java/com/android/server/recoverysystem/RecoverySystemService.java @@ -400,13 +400,9 @@ public class RecoverySystemService extends IRecoverySystem.Stub { * Sends a command to the uncrypt service. * * @param command command to send to the uncrypt service - * @throws IOException if the socket is closed or there was an error writing to the socket + * @throws IOException if there was an error writing to the socket */ public void sendCommand(String command) throws IOException { - if (mLocalSocket.isClosed()) { - throw new IOException("socket is closed"); - } - byte[] cmdUtf8 = command.getBytes(StandardCharsets.UTF_8); mOutputStream.writeInt(cmdUtf8.length); mOutputStream.write(cmdUtf8, 0, cmdUtf8.length); @@ -415,25 +411,17 @@ public class RecoverySystemService extends IRecoverySystem.Stub { /** * Reads the status from the uncrypt service which is usually represented as a percentage. * @return an integer representing the percentage completed - * @throws IOException if the socket was closed or there was an error reading the socket + * @throws IOException if there was an error reading the socket */ public int getPercentageUncrypted() throws IOException { - if (mLocalSocket.isClosed()) { - throw new IOException("socket is closed"); - } - return mInputStream.readInt(); } /** * Sends a confirmation to the uncrypt service. - * @throws IOException if the socket was closed or there was an error writing to the socket + * @throws IOException if there was an error writing to the socket */ public void sendAck() throws IOException { - if (mLocalSocket.isClosed()) { - throw new IOException("socket is closed"); - } - mOutputStream.writeInt(0); } |