diff options
author | Kenny Root <kroot@google.com> | 2013-02-04 15:49:11 -0800 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2013-02-04 15:50:58 -0800 |
commit | e66769ad5194cb4533d1087416a2e804ac384285 (patch) | |
tree | 22123fc2bb1210baa71e79671e44f7a4aad1daf1 /keystore/java | |
parent | 5a720bb9b031d44e593d2054bda586ccc3752aa4 (diff) | |
download | frameworks_base-e66769ad5194cb4533d1087416a2e804ac384285.zip frameworks_base-e66769ad5194cb4533d1087416a2e804ac384285.tar.gz frameworks_base-e66769ad5194cb4533d1087416a2e804ac384285.tar.bz2 |
AndroidKeyStore: return error code on error
Instead of blindly multiplying return value by 1000 to convert to
milliseconds, check to see if it's an error condition first.
Change-Id: I8eab1e7a86d78c13458fcbbc79d590e452fc9791
Diffstat (limited to 'keystore/java')
-rw-r--r-- | keystore/java/android/security/KeyStore.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java index 444dc1d..ceaff37 100644 --- a/keystore/java/android/security/KeyStore.java +++ b/keystore/java/android/security/KeyStore.java @@ -243,7 +243,12 @@ public class KeyStore { */ public long getmtime(String key) { try { - return mBinder.getmtime(key) * 1000L; + final long millis = mBinder.getmtime(key); + if (millis == -1L) { + return -1L; + } + + return millis * 1000L; } catch (RemoteException e) { Log.w(TAG, "Cannot connect to keystore", e); return -1L; |