diff options
author | Chia-chi Yeh <chiachi@android.com> | 2009-09-24 13:29:58 +0800 |
---|---|---|
committer | Chia-chi Yeh <chiachi@android.com> | 2009-09-24 13:29:58 +0800 |
commit | f1ece5d0c16fa3e79390e41ad9bec020c77d7720 (patch) | |
tree | c5c8b20551a9dcf1bb3dcaf52223866a31164a16 /keystore/java/android/security | |
parent | 46a41e0e7f95f43aa7251114f12fd5e2b9933bc7 (diff) | |
download | frameworks_base-f1ece5d0c16fa3e79390e41ad9bec020c77d7720.zip frameworks_base-f1ece5d0c16fa3e79390e41ad9bec020c77d7720.tar.gz frameworks_base-f1ece5d0c16fa3e79390e41ad9bec020c77d7720.tar.bz2 |
KeyStore: return null when response code indicates an error.
Diffstat (limited to 'keystore/java/android/security')
-rw-r--r-- | keystore/java/android/security/KeyStore.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java index a47534b..0a2fe4c 100644 --- a/keystore/java/android/security/KeyStore.java +++ b/keystore/java/android/security/KeyStore.java @@ -172,8 +172,10 @@ public class KeyStore { socket.shutdownOutput(); InputStream in = socket.getInputStream(); - code = in.read(); - if (code == -1) { + if ((code = in.read()) != NO_ERROR) { + if (code != -1) { + mError = code; + } return null; } @@ -194,7 +196,7 @@ public class KeyStore { } results.add(result); } - mError = code; + mError = NO_ERROR; return results.toArray(new byte[results.size()][]); } catch (IOException e) { // ignore |