From fa3f8b08abcc72116dfd86ee18c518b819904c52 Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:39:15 -0500 Subject: [PATCH] Finish deprecation of legacy windows audio device module Co-authored-by: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com> --- ts/calling/audioDeviceModule.ts | 18 --------- .../calling/audioDeviceModule_test.ts | 39 ------------------- ts/types/Storage.d.ts | 3 +- 3 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 ts/calling/audioDeviceModule.ts delete mode 100644 ts/test-both/calling/audioDeviceModule_test.ts diff --git a/ts/calling/audioDeviceModule.ts b/ts/calling/audioDeviceModule.ts deleted file mode 100644 index c409917291..0000000000 --- a/ts/calling/audioDeviceModule.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2021 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import { makeEnumParser } from '../util/enum'; -import OS from '../util/os/osMain'; - -export enum AudioDeviceModule { - Default = 'Default', - WindowsAdm2 = 'WindowsAdm2', -} - -export const parseAudioDeviceModule = makeEnumParser( - AudioDeviceModule, - AudioDeviceModule.Default -); - -export const getAudioDeviceModule = (): AudioDeviceModule => - OS.isWindows() ? AudioDeviceModule.WindowsAdm2 : AudioDeviceModule.Default; diff --git a/ts/test-both/calling/audioDeviceModule_test.ts b/ts/test-both/calling/audioDeviceModule_test.ts deleted file mode 100644 index a14e834660..0000000000 --- a/ts/test-both/calling/audioDeviceModule_test.ts +++ /dev/null @@ -1,39 +0,0 @@ -// 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); - }); - }); -}); diff --git a/ts/types/Storage.d.ts b/ts/types/Storage.d.ts index 9e37dc5e03..d86a89b123 100644 --- a/ts/types/Storage.d.ts +++ b/ts/types/Storage.d.ts @@ -6,7 +6,6 @@ import type { CustomColorsItemType, DefaultConversationColorType, } from './Colors'; -import type { AudioDeviceModule } from '../calling/audioDeviceModule'; import type { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability'; import type { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode'; import type { RetryItemType } from '../util/retryPlaceholders'; @@ -170,7 +169,7 @@ export type StorageAccessType = { // Deprecated 'challenge:retry-message-ids': never; nextSignedKeyRotationTime: number; - previousAudioDeviceModule: AudioDeviceModule; + previousAudioDeviceModule: never; senderCertificateWithUuid: never; signaling_key: never; signedKeyRotationRejected: number;