Convert InternalValues to kotlin.

This commit is contained in:
Greyson Parrelli
2024-11-18 12:18:29 -05:00
parent 5f67bd9725
commit ae37001949
25 changed files with 270 additions and 289 deletions

View File

@@ -193,7 +193,7 @@ object AndroidTelecomUtil {
private fun isTelecomAllowedForDevice(): Boolean {
if (RemoteConfig.internalUser) {
return !SignalStore.internal.callingDisableTelecom()
return !SignalStore.internal.callingDisableTelecom
}
return RingRtcDynamicConfiguration.isTelecomAllowedForDevice()
}

View File

@@ -60,7 +60,7 @@ class CallLinkPreJoinActionProcessor(
.getCallLinkAuthorizationForToday(genericServerPublicParams, callLinkSecretParams)
webRtcInteractor.callManager.createCallLinkCall(
SignalStore.internal.groupCallingServer(),
SignalStore.internal.groupCallingServer,
callLinkAuthCredentialPresentation.serialize(),
callLinkRootKey,
callLink.credentials.adminPassBytes,

View File

@@ -49,7 +49,7 @@ public class GroupNetworkUnavailableActionProcessor extends WebRtcActionProcesso
byte[] groupId = currentState.getCallInfoState().getCallRecipient().requireGroupId().getDecodedId();
GroupCall groupCall = webRtcInteractor.getCallManager().createGroupCall(groupId,
SignalStore.internal().groupCallingServer(),
SignalStore.internal().getGroupCallingServer(),
new byte[0],
null,
RingRtcDynamicConfiguration.getAudioProcessingMethod(),

View File

@@ -47,7 +47,7 @@ public class GroupPreJoinActionProcessor extends GroupActionProcessor {
byte[] groupId = currentState.getCallInfoState().getCallRecipient().requireGroupId().getDecodedId();
GroupCall groupCall = webRtcInteractor.getCallManager().createGroupCall(groupId,
SignalStore.internal().groupCallingServer(),
SignalStore.internal().getGroupCallingServer(),
new byte[0],
AUDIO_LEVELS_INTERVAL,
RingRtcDynamicConfiguration.getAudioProcessingMethod(),

View File

@@ -182,7 +182,7 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
protected @NonNull WebRtcServiceState handleAcceptCall(@NonNull WebRtcServiceState currentState, boolean answerWithVideo) {
byte[] groupId = currentState.getCallInfoState().getCallRecipient().requireGroupId().getDecodedId();
GroupCall groupCall = webRtcInteractor.getCallManager().createGroupCall(groupId,
SignalStore.internal().groupCallingServer(),
SignalStore.internal().getGroupCallingServer(),
new byte[0],
AUDIO_LEVELS_INTERVAL,
RingRtcDynamicConfiguration.getAudioProcessingMethod(),

View File

@@ -15,8 +15,8 @@ object RingRtcDynamicConfiguration {
@JvmStatic
fun getAudioProcessingMethod(): AudioProcessingMethod {
if (SignalStore.internal.callingAudioProcessingMethod() != AudioProcessingMethod.Default) {
return SignalStore.internal.callingAudioProcessingMethod()
if (SignalStore.internal.callingAudioProcessingMethod != AudioProcessingMethod.Default) {
return SignalStore.internal.callingAudioProcessingMethod
}
return if (shouldUseOboeAdm()) {
@@ -57,7 +57,7 @@ object RingRtcDynamicConfiguration {
@JvmStatic
fun shouldUseOboeAdm(): Boolean {
if (RemoteConfig.internalUser) {
return SignalStore.internal.callingEnableOboeAdm()
return SignalStore.internal.callingEnableOboeAdm
}
// For now, only allow the Oboe ADM to be used for custom ROMS.

View File

@@ -415,7 +415,7 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
CallLinkSecretParams.deriveFromRootKey(callLinkRootKey.getKeyBytes())
);
callManager.peekCallLinkCall(SignalStore.internal().groupCallingServer(), callLinkAuthCredentialPresentation.serialize(), callLinkRootKey, peekInfo -> {
callManager.peekCallLinkCall(SignalStore.internal().getGroupCallingServer(), callLinkAuthCredentialPresentation.serialize(), callLinkRootKey, peekInfo -> {
PeekInfo info = peekInfo.getValue();
if (info == null) {
Log.w(TAG, "Failed to get peek info: " + peekInfo.getStatus());
@@ -465,7 +465,7 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
List<GroupCall.GroupMemberInfo> members = Stream.of(GroupManager.getUuidCipherTexts(context, groupId))
.map(entry -> new GroupCall.GroupMemberInfo(entry.getKey(), entry.getValue().serialize()))
.toList();
callManager.peekGroupCall(SignalStore.internal().groupCallingServer(), credential.token.getBytes(Charsets.UTF_8), members, peekInfo -> {
callManager.peekGroupCall(SignalStore.internal().getGroupCallingServer(), credential.token.getBytes(Charsets.UTF_8), members, peekInfo -> {
Long threadId = SignalDatabase.threads().getThreadIdFor(group.getId());
if (threadId != null) {
@@ -508,7 +508,7 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
.map(entry -> new GroupCall.GroupMemberInfo(entry.getKey(), entry.getValue().serialize()))
.collect(Collectors.toList());
callManager.peekGroupCall(SignalStore.internal().groupCallingServer(),
callManager.peekGroupCall(SignalStore.internal().getGroupCallingServer(),
credential.token.getBytes(Charsets.UTF_8),
members,
peekInfo -> receivedGroupCallPeekForRingingCheck(info, peekInfo));

View File

@@ -111,7 +111,7 @@ class SignalCallLinkManager(
// Credential
callManager.createCallLink(
SignalStore.internal.groupCallingServer(),
SignalStore.internal.groupCallingServer,
credentialPresentation.serialize(),
rootKey,
adminPassKey,
@@ -139,7 +139,7 @@ class SignalCallLinkManager(
): Single<ReadCallLinkResult> {
return Single.create { emitter ->
callManager.readCallLink(
SignalStore.internal.groupCallingServer(),
SignalStore.internal.groupCallingServer,
requestCallLinkAuthCredentialPresentation(credentials.linkKeyBytes).serialize(),
CallLinkRootKey(credentials.linkKeyBytes)
) {
@@ -165,7 +165,7 @@ class SignalCallLinkManager(
val credentialPresentation = requestCallLinkAuthCredentialPresentation(credentials.linkKeyBytes)
callManager.updateCallLinkName(
SignalStore.internal.groupCallingServer(),
SignalStore.internal.groupCallingServer,
credentialPresentation.serialize(),
CallLinkRootKey(credentials.linkKeyBytes),
credentials.adminPassBytes,
@@ -192,7 +192,7 @@ class SignalCallLinkManager(
val credentialPresentation = requestCallLinkAuthCredentialPresentation(credentials.linkKeyBytes)
callManager.updateCallLinkRestrictions(
SignalStore.internal.groupCallingServer(),
SignalStore.internal.groupCallingServer,
credentialPresentation.serialize(),
CallLinkRootKey(credentials.linkKeyBytes),
credentials.adminPassBytes,
@@ -218,7 +218,7 @@ class SignalCallLinkManager(
val credentialPresentation = requestCallLinkAuthCredentialPresentation(credentials.linkKeyBytes)
callManager.deleteCallLink(
SignalStore.internal.groupCallingServer(),
SignalStore.internal.groupCallingServer,
credentialPresentation.serialize(),
CallLinkRootKey(credentials.linkKeyBytes),
credentials.adminPassBytes