Prepare the websocket keepalive for API 31.

This commit is contained in:
Greyson Parrelli
2022-09-30 16:41:00 -04:00
parent 437c3ffd66
commit afedbf40e3
8 changed files with 85 additions and 32 deletions

View File

@@ -26,6 +26,7 @@ public final class InternalValues extends SignalStoreValues {
public static final String CALLING_DISABLE_TELECOM = "internal.calling_disable_telecom";
public static final String SHAKE_TO_REPORT = "internal.shake_to_report";
public static final String DISABLE_STORAGE_SERVICE = "internal.disable_storage_service";
public static final String FORCE_WEBSOCKET_MODE = "internal.force_websocket_mode";
InternalValues(KeyValueStore store) {
super(store);
@@ -164,4 +165,15 @@ public final class InternalValues extends SignalStoreValues {
return false;
}
}
/**
* Whether or not the system is forced to be in 'websocket mode', where FCM is ignored and we use a foreground service to keep the app alive.
*/
public boolean isWebsocketModeForced() {
if (FeatureFlags.internalUser()) {
return getBoolean(FORCE_WEBSOCKET_MODE, false);
} else {
return false;
}
}
}