Delete deprecated variants of ios CreateAudioDeviceModule

Bug: webrtc:413413572
Change-Id: I713a76a696db9834e62836c0031d3f89fad369db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/400502
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45159}
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index be38095..878aeb2 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -253,10 +253,6 @@
       rtc_library("native_api_audio_device_module") {
         visibility = [ "*" ]
 
-        # TODO: bugs.webrtc.org/413413572 - Remove the poison when users of this
-        # api provide Environment explicitly.
-        allow_poison = [ "environment_construction" ]
-
         sources = [
           "objc/native/api/audio_device_module.h",
           "objc/native/api/audio_device_module.mm",
@@ -269,7 +265,6 @@
           "../api:scoped_refptr",
           "../api/audio:audio_device",
           "../api/environment",
-          "../api/environment:environment_factory",
           "../modules/audio_device:audio_device_generic",
           "../rtc_base:checks",
           "../rtc_base:logging",
diff --git a/sdk/objc/native/api/audio_device_module.h b/sdk/objc/native/api/audio_device_module.h
index 5a8944c..3448091 100644
--- a/sdk/objc/native/api/audio_device_module.h
+++ b/sdk/objc/native/api/audio_device_module.h
@@ -29,10 +29,6 @@
     const Environment& env,
     bool bypass_voice_processing = false);
 
-[[deprecated("Pass `env` explicitly instead of relying on the default")]]
-scoped_refptr<AudioDeviceModule> CreateAudioDeviceModule(
-    bool bypass_voice_processing = false);
-
 // If `muted_speech_event_handler` is exist, audio unit will catch speech
 // activity while muted.
 // Provide `error_handler` to receive callbacks on errors such as microphone
@@ -43,12 +39,6 @@
     ADMErrorHandler error_handler,
     bool bypass_voice_processing = false);
 
-[[deprecated("Pass `env` explicitly instead of relying on the default")]]
-scoped_refptr<AudioDeviceModule> CreateMutedDetectAudioDeviceModule(
-    AudioDeviceModule::MutedSpeechEventHandler muted_speech_event_handler,
-    ADMErrorHandler error_handler,
-    bool bypass_voice_processing = false);
-
 }  // namespace webrtc
 
 #endif  // SDK_OBJC_NATIVE_API_AUDIO_DEVICE_MODULE_H_
diff --git a/sdk/objc/native/api/audio_device_module.mm b/sdk/objc/native/api/audio_device_module.mm
index 8325179..47fb20d 100644
--- a/sdk/objc/native/api/audio_device_module.mm
+++ b/sdk/objc/native/api/audio_device_module.mm
@@ -11,7 +11,6 @@
 #include "audio_device_module.h"
 
 #include "api/environment/environment.h"
-#include "api/environment/environment_factory.h"
 #include "api/make_ref_counted.h"
 #include "rtc_base/logging.h"
 #include "sdk/objc/native/src/audio/audio_device_module_ios.h"
@@ -32,16 +31,6 @@
       /*error_handler=*/nullptr);
 }
 
-scoped_refptr<AudioDeviceModule> CreateAudioDeviceModule(
-    bool bypass_voice_processing) {
-  RTC_DLOG(LS_INFO) << __FUNCTION__;
-  return make_ref_counted<ios_adm::AudioDeviceModuleIOS>(
-      CreateEnvironment(),
-      bypass_voice_processing,
-      /*muted_speech_event_handler=*/nullptr,
-      /*error_handler=*/nullptr);
-}
-
 scoped_refptr<AudioDeviceModule> CreateMutedDetectAudioDeviceModule(
     const Environment& env,
     AudioDeviceModule::MutedSpeechEventHandler muted_speech_event_handler,
@@ -52,15 +41,4 @@
       env, bypass_voice_processing, muted_speech_event_handler, error_handler);
 }
 
-scoped_refptr<AudioDeviceModule> CreateMutedDetectAudioDeviceModule(
-    AudioDeviceModule::MutedSpeechEventHandler muted_speech_event_handler,
-    ADMErrorHandler error_handler,
-    bool bypass_voice_processing) {
-  RTC_DLOG(LS_INFO) << __FUNCTION__;
-  return make_ref_counted<ios_adm::AudioDeviceModuleIOS>(
-      CreateEnvironment(),
-      bypass_voice_processing,
-      muted_speech_event_handler,
-      error_handler);
-}
 }  // namespace webrtc