Search in sources :

Example 1 with MultiDeviceStickerPackOperationJob

use of org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob in project Signal-Android by WhisperSystems.

the class StickerManagementRepository method installStickerPack.

void installStickerPack(@NonNull String packId, @NonNull String packKey, boolean notify) {
    SignalExecutors.SERIAL.execute(() -> {
        JobManager jobManager = ApplicationDependencies.getJobManager();
        if (stickerDatabase.isPackAvailableAsReference(packId)) {
            stickerDatabase.markPackAsInstalled(packId, notify);
        }
        jobManager.add(StickerPackDownloadJob.forInstall(packId, packKey, notify));
        if (TextSecurePreferences.isMultiDevice(context)) {
            jobManager.add(new MultiDeviceStickerPackOperationJob(packId, packKey, MultiDeviceStickerPackOperationJob.Type.INSTALL));
        }
    });
}
Also used : MultiDeviceStickerPackOperationJob(org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob) JobManager(org.thoughtcrime.securesms.jobmanager.JobManager)

Example 2 with MultiDeviceStickerPackOperationJob

use of org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob in project Signal-Android by WhisperSystems.

the class StickerLaunchMigrationJob method installPack.

private static void installPack(@NonNull Context context, @NonNull BlessedPacks.Pack pack) {
    JobManager jobManager = ApplicationDependencies.getJobManager();
    StickerDatabase stickerDatabase = SignalDatabase.stickers();
    if (stickerDatabase.isPackAvailableAsReference(pack.getPackId())) {
        stickerDatabase.markPackAsInstalled(pack.getPackId(), false);
    }
    jobManager.add(StickerPackDownloadJob.forInstall(pack.getPackId(), pack.getPackKey(), false));
    if (TextSecurePreferences.isMultiDevice(context)) {
        jobManager.add(new MultiDeviceStickerPackOperationJob(pack.getPackId(), pack.getPackKey(), MultiDeviceStickerPackOperationJob.Type.INSTALL));
    }
}
Also used : MultiDeviceStickerPackOperationJob(org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob) StickerDatabase(org.thoughtcrime.securesms.database.StickerDatabase) JobManager(org.thoughtcrime.securesms.jobmanager.JobManager)

Example 3 with MultiDeviceStickerPackOperationJob

use of org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob in project Signal-Android by signalapp.

the class StickerManagementRepository method installStickerPack.

void installStickerPack(@NonNull String packId, @NonNull String packKey, boolean notify) {
    SignalExecutors.SERIAL.execute(() -> {
        JobManager jobManager = ApplicationDependencies.getJobManager();
        if (stickerDatabase.isPackAvailableAsReference(packId)) {
            stickerDatabase.markPackAsInstalled(packId, notify);
        }
        jobManager.add(StickerPackDownloadJob.forInstall(packId, packKey, notify));
        if (TextSecurePreferences.isMultiDevice(context)) {
            jobManager.add(new MultiDeviceStickerPackOperationJob(packId, packKey, MultiDeviceStickerPackOperationJob.Type.INSTALL));
        }
    });
}
Also used : MultiDeviceStickerPackOperationJob(org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob) JobManager(org.thoughtcrime.securesms.jobmanager.JobManager)

Example 4 with MultiDeviceStickerPackOperationJob

use of org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob in project Signal-Android by signalapp.

the class StickerLaunchMigrationJob method installPack.

private static void installPack(@NonNull Context context, @NonNull BlessedPacks.Pack pack) {
    JobManager jobManager = ApplicationDependencies.getJobManager();
    StickerDatabase stickerDatabase = SignalDatabase.stickers();
    if (stickerDatabase.isPackAvailableAsReference(pack.getPackId())) {
        stickerDatabase.markPackAsInstalled(pack.getPackId(), false);
    }
    jobManager.add(StickerPackDownloadJob.forInstall(pack.getPackId(), pack.getPackKey(), false));
    if (TextSecurePreferences.isMultiDevice(context)) {
        jobManager.add(new MultiDeviceStickerPackOperationJob(pack.getPackId(), pack.getPackKey(), MultiDeviceStickerPackOperationJob.Type.INSTALL));
    }
}
Also used : MultiDeviceStickerPackOperationJob(org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob) StickerDatabase(org.thoughtcrime.securesms.database.StickerDatabase) JobManager(org.thoughtcrime.securesms.jobmanager.JobManager)

Aggregations

JobManager (org.thoughtcrime.securesms.jobmanager.JobManager)4 MultiDeviceStickerPackOperationJob (org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackOperationJob)4 StickerDatabase (org.thoughtcrime.securesms.database.StickerDatabase)2