Remove unnecessary start of KeyCachingService.

This commit is contained in:
Greyson Parrelli 2018-10-10 08:50:35 -07:00
parent 89f97f57cb
commit 5219d79e27
2 changed files with 2 additions and 7 deletions

View File

@ -96,7 +96,7 @@ public class MmsDownloadJob extends MasterSecretJob {
@Override
public void onAdded() {
if (automatic && KeyCachingService.getMasterSecret(context) == null) {
if (automatic && KeyCachingService.isLocked(context)) {
DatabaseFactory.getMmsDatabase(context).markIncomingNotificationReceived(threadId);
MessageNotifier.updateNotification(context);
}

View File

@ -89,12 +89,7 @@ public class KeyCachingService extends Service {
public static synchronized @Nullable MasterSecret getMasterSecret(Context context) {
if (masterSecret == null && (TextSecurePreferences.isPasswordDisabled(context) && !TextSecurePreferences.isScreenLockEnabled(context))) {
try {
MasterSecret masterSecret = MasterSecretUtil.getMasterSecret(context, MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
Intent intent = new Intent(context, KeyCachingService.class);
context.startService(intent);
return masterSecret;
return MasterSecretUtil.getMasterSecret(context, MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
} catch (InvalidPassphraseException e) {
Log.w("KeyCachingService", e);
}