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
This commit is contained in:
Kenny Root
2013-02-04 15:49:11 -08:00
parent 5a720bb9b0
commit e66769ad51

View File

@@ -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;