diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index f005f46d1f61..63f44f44ad2d 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -3162,8 +3162,8 @@ RefPtr MediaManager::GetUserMedia( GetCurrentSerialEventTarget(), __func__, [self, windowID, c, windowListener, placeholderListener, hasAudio, hasVideo, askPermission, prefs, isSecure, isHandlingUserInput, - callID, principalInfo, aCallerType, resistFingerprinting, - audioType](RefPtr aDevices) mutable { + callID, principalInfo, aCallerType, resistFingerprinting, audioType, + forceFakes](RefPtr aDevices) mutable { LOG("GetUserMedia: starting post enumeration promise2 success " "callback!"); @@ -3226,6 +3226,10 @@ RefPtr MediaManager::GetUserMedia( // It is time to ask for user permission, prime voice processing // now. Use a local lambda to enable a guard pattern. [&] { + if (forceFakes) { + return; + } + if (audioType != MediaSourceEnum::Microphone) { return; }