mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Use foreground services to process notification when appropriate.
Right now, the only condition is once every 3 minutes on Android 12. This is ok because Android 12 will allow us (once every 2 minutes or so) to start a foreground service, and it won't show it for the first 10 seconds. So we can kind of do it without any visual penalty.
This commit is contained in:
@@ -21,6 +21,7 @@ public final class MiscellaneousValues extends SignalStoreValues {
|
||||
private static final String CENSORSHIP_SERVICE_REACHABLE = "misc.censorship.service_reachable";
|
||||
private static final String LAST_GV2_PROFILE_CHECK_TIME = "misc.last_gv2_profile_check_time";
|
||||
private static final String CDS_TOKEN = "misc.cds_token";
|
||||
private static final String LAST_FCM_FOREGROUND_TIME = "misc.last_fcm_foreground_time";
|
||||
|
||||
MiscellaneousValues(@NonNull KeyValueStore store) {
|
||||
super(store);
|
||||
@@ -149,4 +150,12 @@ public final class MiscellaneousValues extends SignalStoreValues {
|
||||
.putBlob(CDS_TOKEN, token)
|
||||
.commit();
|
||||
}
|
||||
|
||||
public long getLastFcmForegroundServiceTime() {
|
||||
return getLong(LAST_FCM_FOREGROUND_TIME, 0);
|
||||
}
|
||||
|
||||
public void setLastFcmForegroundServiceTime(long time) {
|
||||
putLong(LAST_FCM_FOREGROUND_TIME, time);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user