Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e66769ad authored by Kenny Root's avatar Kenny Root
Browse files

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
parent 5a720bb9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;