Add feature flag for ADM2 on Windows
This commit is contained in:
parent
8256170066
commit
3bd3207e18
3 changed files with 23 additions and 7 deletions
|
@ -8,6 +8,7 @@ import * as log from './logging/log';
|
|||
|
||||
export type ConfigKeyType =
|
||||
| 'desktop.announcementGroup'
|
||||
| 'desktop.calling.useWindowsAdm2'
|
||||
| 'desktop.clientExpiration'
|
||||
| 'desktop.disableGV1'
|
||||
| 'desktop.groupCallOutboundRing'
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { makeEnumParser } from '../util/enum';
|
||||
import { isEnabled } from '../RemoteConfig';
|
||||
import { isAlpha, isBeta } from '../util/version';
|
||||
import * as OS from '../OS';
|
||||
|
||||
export enum AudioDeviceModule {
|
||||
Default = 'Default',
|
||||
|
@ -12,3 +15,20 @@ export const parseAudioDeviceModule = makeEnumParser(
|
|||
AudioDeviceModule,
|
||||
AudioDeviceModule.Default
|
||||
);
|
||||
|
||||
export function getAudioDeviceModule(): AudioDeviceModule {
|
||||
if (!OS.isWindows()) {
|
||||
return AudioDeviceModule.Default;
|
||||
}
|
||||
|
||||
const appVersion = window.getVersion();
|
||||
if (
|
||||
isEnabled('desktop.calling.useWindowsAdm2') ||
|
||||
isBeta(appVersion) ||
|
||||
isAlpha(appVersion)
|
||||
) {
|
||||
return AudioDeviceModule.WindowsAdm2;
|
||||
}
|
||||
|
||||
return AudioDeviceModule.Default;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ import {
|
|||
} from '../types/Calling';
|
||||
import {
|
||||
AudioDeviceModule,
|
||||
getAudioDeviceModule,
|
||||
parseAudioDeviceModule,
|
||||
} from '../calling/audioDeviceModule';
|
||||
import {
|
||||
|
@ -65,7 +66,6 @@ import {
|
|||
} from '../calling/findBestMatchingDevice';
|
||||
import type { LocalizerType } from '../types/Util';
|
||||
import { UUID } from '../types/UUID';
|
||||
import * as OS from '../OS';
|
||||
import type { ConversationModel } from '../models/conversations';
|
||||
import * as Bytes from '../Bytes';
|
||||
import { uuidToBytes, bytesToUuid } from '../Crypto';
|
||||
|
@ -74,7 +74,6 @@ import { getOwn } from '../util/getOwn';
|
|||
import { isNormalNumber } from '../util/isNormalNumber';
|
||||
import * as durations from '../util/durations';
|
||||
import { handleMessageSend } from '../util/handleMessageSend';
|
||||
import { isAlpha, isBeta } from '../util/version';
|
||||
import {
|
||||
fetchMembershipProof,
|
||||
getMembershipList,
|
||||
|
@ -257,11 +256,7 @@ export class CallingClass {
|
|||
this.previousAudioDeviceModule = parseAudioDeviceModule(
|
||||
window.storage.get('previousAudioDeviceModule')
|
||||
);
|
||||
this.currentAudioDeviceModule =
|
||||
OS.isWindows() &&
|
||||
(isAlpha(window.getVersion()) || isBeta(window.getVersion()))
|
||||
? AudioDeviceModule.WindowsAdm2
|
||||
: AudioDeviceModule.Default;
|
||||
this.currentAudioDeviceModule = getAudioDeviceModule();
|
||||
window.storage.put(
|
||||
'previousAudioDeviceModule',
|
||||
this.currentAudioDeviceModule
|
||||
|
|
Loading…
Add table
Reference in a new issue