Always use new foreground service utils.

This commit is contained in:
Greyson Parrelli
2022-11-29 14:40:29 -05:00
committed by Cody Henthorne
parent 7b13550086
commit 23804046c6
19 changed files with 350 additions and 126 deletions

View File

@@ -22,6 +22,7 @@ import org.thoughtcrime.securesms.crypto.AttachmentSecretProvider;
import org.thoughtcrime.securesms.crypto.MasterCipher;
import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.crypto.MasterSecretUtil;
import org.thoughtcrime.securesms.jobs.UnableToStartException;
import org.thoughtcrime.securesms.migrations.LegacyMigrationJob;
import org.thoughtcrime.securesms.service.GenericForegroundService;
import org.thoughtcrime.securesms.service.NotificationController;
@@ -51,7 +52,7 @@ public class SQLCipherMigrationHelper {
copyTable("recipient_preferences", legacyDb, modernDb, null);
copyTable("group_receipts", legacyDb, modernDb, null);
modernDb.setTransactionSuccessful();
} catch (GenericForegroundService.UnableToStartException e) {
} catch (UnableToStartException e) {
throw new IllegalStateException(e);
} finally {
modernDb.endTransaction();
@@ -176,7 +177,7 @@ public class SQLCipherMigrationHelper {
AttachmentSecretProvider.getInstance(context).setClassicKey(context, masterSecret.getEncryptionKey().getEncoded(), masterSecret.getMacKey().getEncoded());
TextSecurePreferences.setNeedsSqlCipherMigration(context, false);
modernDb.setTransactionSuccessful();
} catch (GenericForegroundService.UnableToStartException e) {
} catch (UnableToStartException e) {
throw new IllegalStateException(e);
} finally {
modernDb.endTransaction();