From e6e5cb5adb06e95786946e347a44975dac4f2145 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Tue, 19 May 2020 16:26:11 +1000 Subject: [PATCH] Clean --- AndroidManifest.xml | 6 ------ .../securesms/service/KeyCachingService.java | 12 +----------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 4991e9ad5e..1ea69e4192 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -16,12 +16,6 @@ - diff --git a/src/org/thoughtcrime/securesms/service/KeyCachingService.java b/src/org/thoughtcrime/securesms/service/KeyCachingService.java index 14a789c0c7..4dc3e89cb5 100644 --- a/src/org/thoughtcrime/securesms/service/KeyCachingService.java +++ b/src/org/thoughtcrime/securesms/service/KeyCachingService.java @@ -76,10 +76,6 @@ public class KeyCachingService extends Service { private static MasterSecret masterSecret; - // Loki - Caching - private static MasterSecret cachedSecret; - private static long cacheTime = 0; - public KeyCachingService() {} public static synchronized boolean isLocked(Context context) { @@ -89,13 +85,7 @@ public class KeyCachingService extends Service { public static synchronized @Nullable MasterSecret getMasterSecret(Context context) { if (masterSecret == null && (TextSecurePreferences.isPasswordDisabled(context) && !TextSecurePreferences.isScreenLockEnabled(context))) { try { - // Loki - Cache the secret. - // TODO: Don't know if this will affect any other Signal code but it makes it so we're not wasting time re-fetching the same secret from the database - if (cachedSecret == null || cacheTime < System.currentTimeMillis()) { - cachedSecret = MasterSecretUtil.getMasterSecret(context, MasterSecretUtil.UNENCRYPTED_PASSPHRASE); - cacheTime = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(5); - } - return cachedSecret; + return MasterSecretUtil.getMasterSecret(context, MasterSecretUtil.UNENCRYPTED_PASSPHRASE); } catch (InvalidPassphraseException e) { Log.w("KeyCachingService", e); }