Remove APM internal usage of EchoCancellation

This CL:
 - Changes EchoCancellationImpl to inherit privately from
   EchoCancellation.
 - Removes usage of AudioProcessing::echo_cancellation() inside most of
   the audio processing module and unit tests.
 - Default-enables metrics collection in AEC2.

This CL breaks audioproc_f backwards compatibility: It can no longer
use all recorded settings (drift compensation, suppression level), but
prints an error message when such settings are encountered.

Some code in audio_processing_unittest.cc still uses the old interface.
I'll handle that in a separate change, as it is not as straightforward
to preserve coverage.

Bug: webrtc:9535
Change-Id: Ia4d4b8d117ccbe516e5345c15d37298418590686
Reviewed-on: https://webrtc-review.googlesource.com/97603
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24724}
diff --git a/modules/audio_processing/test/debug_dump_test.cc b/modules/audio_processing/test/debug_dump_test.cc
index 8b83c0f..509a904 100644
--- a/modules/audio_processing/test/debug_dump_test.cc
+++ b/modules/audio_processing/test/debug_dump_test.cc
@@ -359,12 +359,13 @@
 
 TEST_F(DebugDumpTest, ToggleAec) {
   Config config;
-  DebugDumpGenerator generator(config, AudioProcessing::Config());
+  AudioProcessing::Config apm_config;
+  DebugDumpGenerator generator(config, apm_config);
   generator.StartRecording();
   generator.Process(100);
 
-  EchoCancellation* aec = generator.apm()->echo_cancellation();
-  EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(!aec->is_enabled()));
+  apm_config.echo_canceller.enabled = true;
+  generator.apm()->ApplyConfig(apm_config);
 
   generator.Process(100);
   generator.StopRecording();
@@ -374,12 +375,13 @@
 TEST_F(DebugDumpTest, ToggleDelayAgnosticAec) {
   Config config;
   config.Set<DelayAgnostic>(new DelayAgnostic(true));
-  DebugDumpGenerator generator(config, AudioProcessing::Config());
+  AudioProcessing::Config apm_config;
+  DebugDumpGenerator generator(config, apm_config);
   generator.StartRecording();
   generator.Process(100);
 
-  EchoCancellation* aec = generator.apm()->echo_cancellation();
-  EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(!aec->is_enabled()));
+  apm_config.echo_canceller.enabled = true;
+  generator.apm()->ApplyConfig(apm_config);
 
   generator.Process(100);
   generator.StopRecording();
@@ -548,15 +550,13 @@
   AudioProcessing::Config apm_config;
   apm_config.echo_canceller.enabled = true;
   apm_config.echo_canceller.mobile_mode = false;
+  apm_config.echo_canceller.legacy_moderate_suppression_level = true;
   DebugDumpGenerator generator(config, apm_config);
-  EchoCancellation* aec = generator.apm()->echo_cancellation();
-  EXPECT_EQ(AudioProcessing::kNoError,
-            aec->set_suppression_level(EchoCancellation::kLowSuppression));
   generator.StartRecording();
   generator.Process(100);
 
-  EXPECT_EQ(AudioProcessing::kNoError,
-            aec->set_suppression_level(EchoCancellation::kHighSuppression));
+  apm_config.echo_canceller.legacy_moderate_suppression_level = false;
+  generator.apm()->ApplyConfig(apm_config);
   generator.Process(100);
   generator.StopRecording();
   VerifyDebugDump(generator.dump_file_name());