mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Verify backup can be decrypted as part of creation flow.
This commit is contained in:
@@ -163,6 +163,28 @@ public final class GenericForegroundService extends Service {
|
||||
ContextCompat.startForegroundService(context, intent);
|
||||
}
|
||||
|
||||
synchronized void replaceTitle(int id, @NonNull String title) {
|
||||
Entry oldEntry = allActiveMessages.get(id);
|
||||
|
||||
if (oldEntry == null) {
|
||||
Log.w(TAG, "Failed to replace notification, it was not found");
|
||||
return;
|
||||
}
|
||||
|
||||
Entry newEntry = new Entry(title, oldEntry.channelId, oldEntry.iconRes, oldEntry.id, oldEntry.progressMax, oldEntry.progress, oldEntry.indeterminate);
|
||||
|
||||
if (oldEntry.equals(newEntry)) {
|
||||
Log.d(TAG, String.format("handleReplace() skip, no change %s", newEntry));
|
||||
return;
|
||||
}
|
||||
|
||||
Log.i(TAG, String.format("handleReplace() %s", newEntry));
|
||||
|
||||
allActiveMessages.put(newEntry.id, newEntry);
|
||||
|
||||
updateNotification();
|
||||
}
|
||||
|
||||
synchronized void replaceProgress(int id, int progressMax, int progress, boolean indeterminate) {
|
||||
Entry oldEntry = allActiveMessages.get(id);
|
||||
|
||||
|
||||
@@ -67,6 +67,14 @@ public final class NotificationController implements AutoCloseable,
|
||||
setProgress((int) newProgressMax, (int) newProgress, false);
|
||||
}
|
||||
|
||||
public void replaceTitle(@NonNull String title) {
|
||||
GenericForegroundService genericForegroundService = service.get();
|
||||
|
||||
if (genericForegroundService == null) return;
|
||||
|
||||
genericForegroundService.replaceTitle(id, title);
|
||||
}
|
||||
|
||||
private synchronized void setProgress(int newProgressMax, int newProgress, boolean indeterminant) {
|
||||
int newPercent = newProgressMax != 0 ? 100 * newProgress / newProgressMax : -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user