mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-20 00:18:26 +00:00
Clean
This commit is contained in:
parent
7b143fa7e9
commit
e6e5cb5adb
@ -16,12 +16,6 @@
|
|||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.bluetooth"
|
android:name="android.hardware.bluetooth"
|
||||||
android:required="false" />
|
android:required="false" />
|
||||||
<!--
|
|
||||||
Loki - Enable again once we have location sharing
|
|
||||||
<uses-feature android:name="android.hardware.location" android:required="false"/>
|
|
||||||
<uses-feature android:name="android.hardware.location.network" android:required="false"/>
|
|
||||||
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
|
|
||||||
-->
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.microphone"
|
android:name="android.hardware.microphone"
|
||||||
android:required="false" />
|
android:required="false" />
|
||||||
|
@ -76,10 +76,6 @@ public class KeyCachingService extends Service {
|
|||||||
|
|
||||||
private static MasterSecret masterSecret;
|
private static MasterSecret masterSecret;
|
||||||
|
|
||||||
// Loki - Caching
|
|
||||||
private static MasterSecret cachedSecret;
|
|
||||||
private static long cacheTime = 0;
|
|
||||||
|
|
||||||
public KeyCachingService() {}
|
public KeyCachingService() {}
|
||||||
|
|
||||||
public static synchronized boolean isLocked(Context context) {
|
public static synchronized boolean isLocked(Context context) {
|
||||||
@ -89,13 +85,7 @@ public class KeyCachingService extends Service {
|
|||||||
public static synchronized @Nullable MasterSecret getMasterSecret(Context context) {
|
public static synchronized @Nullable MasterSecret getMasterSecret(Context context) {
|
||||||
if (masterSecret == null && (TextSecurePreferences.isPasswordDisabled(context) && !TextSecurePreferences.isScreenLockEnabled(context))) {
|
if (masterSecret == null && (TextSecurePreferences.isPasswordDisabled(context) && !TextSecurePreferences.isScreenLockEnabled(context))) {
|
||||||
try {
|
try {
|
||||||
// Loki - Cache the secret.
|
return MasterSecretUtil.getMasterSecret(context, MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
|
||||||
// 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;
|
|
||||||
} catch (InvalidPassphraseException e) {
|
} catch (InvalidPassphraseException e) {
|
||||||
Log.w("KeyCachingService", e);
|
Log.w("KeyCachingService", e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user