|
| 1 | +import { logger } from '../lib/logging'; |
| 2 | + |
| 3 | +export interface CallKeepConfig { |
| 4 | + appName: string; |
| 5 | + maximumCallGroups: number; |
| 6 | + maximumCallsPerCallGroup: number; |
| 7 | + includesCallsInRecents: boolean; |
| 8 | + supportsVideo: boolean; |
| 9 | + ringtoneSound?: string; |
| 10 | +} |
| 11 | + |
| 12 | +/** |
| 13 | + * No-op implementation of CallKeepService for Android |
| 14 | + * CallKeep functionality is only supported on iOS |
| 15 | + */ |
| 16 | +export class CallKeepService { |
| 17 | + private static instance: CallKeepService | null = null; |
| 18 | + |
| 19 | + private constructor() {} |
| 20 | + |
| 21 | + static getInstance(): CallKeepService { |
| 22 | + if (!CallKeepService.instance) { |
| 23 | + CallKeepService.instance = new CallKeepService(); |
| 24 | + } |
| 25 | + return CallKeepService.instance; |
| 26 | + } |
| 27 | + |
| 28 | + async setup(_config: CallKeepConfig): Promise<void> { |
| 29 | + logger.debug({ |
| 30 | + message: 'CallKeep setup skipped - not supported on Android', |
| 31 | + }); |
| 32 | + } |
| 33 | + |
| 34 | + async startCall(_displayName: string): Promise<string> { |
| 35 | + logger.debug({ |
| 36 | + message: 'CallKeep startCall skipped - not supported on Android', |
| 37 | + }); |
| 38 | + return ''; |
| 39 | + } |
| 40 | + |
| 41 | + async endCall(): Promise<void> { |
| 42 | + logger.debug({ |
| 43 | + message: 'CallKeep endCall skipped - not supported on Android', |
| 44 | + }); |
| 45 | + } |
| 46 | + |
| 47 | + async setMuted(_muted: boolean): Promise<void> { |
| 48 | + logger.debug({ |
| 49 | + message: 'CallKeep setMuted skipped - not supported on Android', |
| 50 | + }); |
| 51 | + } |
| 52 | + |
| 53 | + setMuteStateCallback(_callback: (muted: boolean) => void | null): void { |
| 54 | + logger.debug({ |
| 55 | + message: 'CallKeep setMuteStateCallback skipped - not supported on Android', |
| 56 | + }); |
| 57 | + } |
| 58 | + |
| 59 | + async updateCallDisplay(_displayName: string): Promise<void> { |
| 60 | + logger.debug({ |
| 61 | + message: 'CallKeep updateCallDisplay skipped - not supported on Android', |
| 62 | + }); |
| 63 | + } |
| 64 | + |
| 65 | + isCallActive(): boolean { |
| 66 | + return false; |
| 67 | + } |
| 68 | + |
| 69 | + async cleanup(): Promise<void> { |
| 70 | + logger.debug({ |
| 71 | + message: 'CallKeep cleanup skipped - not supported on Android', |
| 72 | + }); |
| 73 | + } |
| 74 | +} |
| 75 | + |
| 76 | +// Export singleton instance |
| 77 | +export const callKeepService = CallKeepService.getInstance(); |
0 commit comments