Remove unneeded *_NOT_SUPPORTED from VoEAudioProcessing.

* Remove ANDROID_NOT_SUPPORTED from a bunch of echo metrics calls
where it actually is supported.
* No error to call GetTypingDetectionStatus.
* Consolidate typing detection disablement to reduce boilerplate.

R=niklas.enbom@webrtc.org, xians@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1683004

git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@4247 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/engine_configurations.h b/engine_configurations.h
index 01fa364..22b87e8 100644
--- a/engine_configurations.h
+++ b/engine_configurations.h
@@ -11,6 +11,8 @@
 #ifndef WEBRTC_ENGINE_CONFIGURATIONS_H_
 #define WEBRTC_ENGINE_CONFIGURATIONS_H_
 
+#include "webrtc/typedefs.h"
+
 // ============================================================================
 //                              Voice and Video
 // ============================================================================
@@ -61,7 +63,8 @@
 #define WEBRTC_VOICE_ENGINE_NR                  // Near-end NS
 #define WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT
 
-#ifndef WEBRTC_CHROMIUM_BUILD
+#if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS) && \
+    !defined(WEBRTC_CHROMIUM_BUILD)
 #define WEBRTC_VOICE_ENGINE_TYPING_DETECTION    // Typing detection
 #endif
 
diff --git a/voice_engine/voe_audio_processing_impl.cc b/voice_engine/voe_audio_processing_impl.cc
index 5908ef1..a1743ea 100644
--- a/voice_engine/voe_audio_processing_impl.cc
+++ b/voice_engine/voe_audio_processing_impl.cc
@@ -767,8 +767,6 @@
   VoERxVadCallback& observer) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "RegisterRxVadObserver()");
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
     return -1;
@@ -786,8 +784,6 @@
 int VoEAudioProcessingImpl::DeRegisterRxVadObserver(int channel) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "DeRegisterRxVadObserver()");
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
     return -1;
@@ -827,8 +823,6 @@
 int VoEAudioProcessingImpl::SetEcMetricsStatus(bool enable) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "SetEcMetricsStatus(enable=%d)", enable);
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-
 #ifdef WEBRTC_VOICE_ENGINE_ECHO
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
@@ -854,8 +848,6 @@
 int VoEAudioProcessingImpl::GetEcMetricsStatus(bool& enabled) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "GetEcMetricsStatus(enabled=?)");
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-
 #ifdef WEBRTC_VOICE_ENGINE_ECHO
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
@@ -891,8 +883,6 @@
                                            int& A_NLP) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "GetEchoMetrics(ERL=?, ERLE=?, RERL=?, A_NLP=?)");
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-
 #ifdef WEBRTC_VOICE_ENGINE_ECHO
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
@@ -934,8 +924,6 @@
                                               int& delay_std) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "GetEcDelayMetrics(median=?, std=?)");
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-
 #ifdef WEBRTC_VOICE_ENGINE_ECHO
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
@@ -998,9 +986,9 @@
 int VoEAudioProcessingImpl::SetTypingDetectionStatus(bool enable) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "SetTypingDetectionStatus()");
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-  IPHONE_NOT_SUPPORTED(_shared->statistics());
-#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
+#if !defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION)
+  NOT_SUPPORTED(_shared->statistics());
+#else
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
     return -1;
@@ -1022,20 +1010,12 @@
   }
 
   return 0;
-#else
-  _shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceError,
-      "SetTypingDetectionStatus is not supported");
-  return -1;
 #endif
 }
 
 int VoEAudioProcessingImpl::GetTypingDetectionStatus(bool& enabled) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "GetTypingDetectionStatus()");
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-  IPHONE_NOT_SUPPORTED(_shared->statistics());
-
-#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
     return -1;
@@ -1046,21 +1026,15 @@
   enabled = _shared->audio_processing()->voice_detection()->is_enabled();
 
   return 0;
-#else
-  _shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceError,
-      "SetTypingDetectionStatus is not supported");
-  return -1;
-#endif
 }
 
 
 int VoEAudioProcessingImpl::TimeSinceLastTyping(int &seconds) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "TimeSinceLastTyping()");
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-  IPHONE_NOT_SUPPORTED(_shared->statistics());
-
-#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
+#if !defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION)
+  NOT_SUPPORTED(_shared->statistics());
+#else
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
     return -1;
@@ -1078,10 +1052,6 @@
       "SetTypingDetectionStatus is not enabled");
   return -1;
   }
-#else
-  _shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceError,
-      "SetTypingDetectionStatus is not supported");
-  return -1;
 #endif
 }
 
@@ -1092,21 +1062,15 @@
                                                          int typeEventDelay) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
                "SetTypingDetectionParameters()");
-  ANDROID_NOT_SUPPORTED(_shared->statistics());
-  IPHONE_NOT_SUPPORTED(_shared->statistics());
-
-#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
+#if !defined(WEBRTC_VOICE_ENGINE_TYPING_DETECTION)
+  NOT_SUPPORTED(_shared->statistics());
+#else
   if (!_shared->statistics().Initialized()) {
     _shared->statistics().SetLastError(VE_NOT_INITED, kTraceError);
     return -1;
   }
   return (_shared->transmit_mixer()->SetTypingDetectionParameters(timeWindow,
       costPerTyping, reportingThreshold, penaltyDecay, typeEventDelay));
-
-#else
-  _shared->statistics().SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceError,
-      "SetTypingDetectionParameters is not supported");
-  return -1;
 #endif
 }
 
diff --git a/voice_engine/voice_engine_defines.h b/voice_engine/voice_engine_defines.h
index ffb9c24..e1e9cdf 100644
--- a/voice_engine/voice_engine_defines.h
+++ b/voice_engine/voice_engine_defines.h
@@ -315,8 +315,6 @@
   // Always excluded for Android builds
   #undef WEBRTC_CODEC_ISAC
   #undef WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT
-  #undef WEBRTC_CONFERENCING
-  #undef WEBRTC_TYPING_DETECTION
 
   #define ANDROID_NOT_SUPPORTED(stat) NOT_SUPPORTED(stat)