Remove ADM2 feature flag
This commit is contained in:
parent
3ec96bde78
commit
71e9498961
3 changed files with 41 additions and 19 deletions
|
@ -8,7 +8,6 @@ import * as log from './logging/log';
|
||||||
|
|
||||||
export type ConfigKeyType =
|
export type ConfigKeyType =
|
||||||
| 'desktop.announcementGroup'
|
| 'desktop.announcementGroup'
|
||||||
| 'desktop.calling.useWindowsAdm2'
|
|
||||||
| 'desktop.canResizeLeftPane.beta'
|
| 'desktop.canResizeLeftPane.beta'
|
||||||
| 'desktop.canResizeLeftPane.production'
|
| 'desktop.canResizeLeftPane.production'
|
||||||
| 'desktop.clientExpiration'
|
| 'desktop.clientExpiration'
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import { makeEnumParser } from '../util/enum';
|
import { makeEnumParser } from '../util/enum';
|
||||||
import { isEnabled } from '../RemoteConfig';
|
|
||||||
import { isAlpha, isBeta } from '../util/version';
|
|
||||||
import * as OS from '../OS';
|
import * as OS from '../OS';
|
||||||
|
|
||||||
export enum AudioDeviceModule {
|
export enum AudioDeviceModule {
|
||||||
|
@ -16,19 +14,5 @@ export const parseAudioDeviceModule = makeEnumParser(
|
||||||
AudioDeviceModule.Default
|
AudioDeviceModule.Default
|
||||||
);
|
);
|
||||||
|
|
||||||
export function getAudioDeviceModule(): AudioDeviceModule {
|
export const getAudioDeviceModule = (): AudioDeviceModule =>
|
||||||
if (!OS.isWindows()) {
|
OS.isWindows() ? AudioDeviceModule.WindowsAdm2 : AudioDeviceModule.Default;
|
||||||
return AudioDeviceModule.Default;
|
|
||||||
}
|
|
||||||
|
|
||||||
const appVersion = window.getVersion();
|
|
||||||
if (
|
|
||||||
isEnabled('desktop.calling.useWindowsAdm2') ||
|
|
||||||
isBeta(appVersion) ||
|
|
||||||
isAlpha(appVersion)
|
|
||||||
) {
|
|
||||||
return AudioDeviceModule.WindowsAdm2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return AudioDeviceModule.Default;
|
|
||||||
}
|
|
||||||
|
|
39
ts/test-both/calling/audioDeviceModule_test.ts
Normal file
39
ts/test-both/calling/audioDeviceModule_test.ts
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
import { assert } from 'chai';
|
||||||
|
import * as sinon from 'sinon';
|
||||||
|
|
||||||
|
import {
|
||||||
|
AudioDeviceModule,
|
||||||
|
getAudioDeviceModule,
|
||||||
|
} from '../../calling/audioDeviceModule';
|
||||||
|
|
||||||
|
describe('audio device module', () => {
|
||||||
|
describe('getAudioDeviceModule', () => {
|
||||||
|
let sandbox: sinon.SinonSandbox;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
sandbox = sinon.createSandbox();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
sandbox.restore();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns ADM2 on Windows', () => {
|
||||||
|
sandbox.stub(process, 'platform').get(() => 'win32');
|
||||||
|
assert.strictEqual(getAudioDeviceModule(), AudioDeviceModule.WindowsAdm2);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns the default module on macOS', () => {
|
||||||
|
sandbox.stub(process, 'platform').get(() => 'darwin');
|
||||||
|
assert.strictEqual(getAudioDeviceModule(), AudioDeviceModule.Default);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns the default module on Linux', () => {
|
||||||
|
sandbox.stub(process, 'platform').get(() => 'linux');
|
||||||
|
assert.strictEqual(getAudioDeviceModule(), AudioDeviceModule.Default);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue