Merge "libeffects: AEC mobile mode set as default" am: 1b676d1d25

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1511089

Change-Id: I1a7d2ed63d2223625a6ebd412340809a6f2f878c
diff --git a/media/libeffects/preprocessing/PreProcessing.cpp b/media/libeffects/preprocessing/PreProcessing.cpp
index f2f74a5..d8840b2 100644
--- a/media/libeffects/preprocessing/PreProcessing.cpp
+++ b/media/libeffects/preprocessing/PreProcessing.cpp
@@ -775,7 +775,7 @@
 #else
     effect->session->config =
         effect->session->apm->GetConfig() ;
-    effect->session->config.echo_canceller.mobile_mode = false;
+    effect->session->config.echo_canceller.mobile_mode = true;
     effect->session->apm->ApplyConfig(effect->session->config);
 #endif
     return 0;
diff --git a/media/libeffects/preprocessing/tests/PreProcessingTest.cpp b/media/libeffects/preprocessing/tests/PreProcessingTest.cpp
index 3244c1f..3e8ea76 100644
--- a/media/libeffects/preprocessing/tests/PreProcessingTest.cpp
+++ b/media/libeffects/preprocessing/tests/PreProcessingTest.cpp
@@ -58,7 +58,6 @@
   ARG_AEC_DELAY,
   ARG_NS_LVL,
 #ifndef WEBRTC_LEGACY
-  ARG_AEC_MOBILE,
   ARG_AGC2_GAIN,
   ARG_AGC2_LVL,
   ARG_AGC2_SAT_MGN
@@ -159,10 +158,6 @@
 #endif
   printf("\n     --aec_delay <delay>");
   printf("\n           AEC delay value in ms, default value 0ms");
-#ifndef WEBRTC_LEGACY
-  printf("\n     --aec_mobile");
-  printf("\n           Enable mobile mode of echo canceller, default disabled");
-#endif
   printf("\n");
 }
 
@@ -213,9 +208,6 @@
   const char *outputFile = nullptr;
   const char *farFile = nullptr;
   int effectEn[PREPROC_NUM_EFFECTS] = {0};
-#ifndef WEBRTC_LEGACY
-  int aecMobileMode = 0;
-#endif
 
   const option long_opts[] = {
       {"help", no_argument, nullptr, ARG_HELP},
@@ -239,9 +231,6 @@
       {"agc2", no_argument, &effectEn[PREPROC_AGC2], 1},
 #endif
       {"ns", no_argument, &effectEn[PREPROC_NS], 1},
-#ifndef WEBRTC_LEGACY
-      {"aec_mobile", no_argument, &aecMobileMode, 1},
-#endif
       {nullptr, 0, nullptr, 0},
   };
   struct preProcConfigParams_t preProcCfgParams {};
@@ -432,16 +421,6 @@
       return EXIT_FAILURE;
     }
   }
-#ifndef WEBRTC_LEGACY
-  if (effectEn[PREPROC_AEC]) {
-    if (int status = preProcSetConfigParam(AEC_PARAM_MOBILE_MODE, (uint32_t)aecMobileMode,
-                                           effectHandle[PREPROC_AEC]);
-        status != 0) {
-      ALOGE("Invalid AEC mobile mode value %d\n", status);
-      return EXIT_FAILURE;
-    }
-  }
-#endif
 
   // Process Call
   const int frameLength = (int)(preProcCfgParams.samplingFreq * kTenMilliSecVal);