am 371dd500: am c83d46a2: Merge "Add near-ultrasound properties to AudioManager.java" into mnc-dev

* commit '371dd5003e6c470f7021ad1fb8d2c853ecb5ba98':
  Add near-ultrasound properties to AudioManager.java
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index d851ad7..eeac69a 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -38,6 +38,7 @@
 import android.os.Message;
 import android.os.Process;
 import android.os.RemoteException;
+import android.os.SystemProperties;
 import android.os.SystemClock;
 import android.os.ServiceManager;
 import android.provider.Settings;
@@ -64,6 +65,16 @@
     private static final AudioPortEventHandler sAudioPortEventHandler = new AudioPortEventHandler();
 
     /**
+     * System properties for whether the default microphone and speaker paths support
+     * near-ultrasound frequencies (range of 18 - 21 kHz).
+     */
+    private static final String SYSTEM_PROPERTY_MIC_NEAR_ULTRASOUND =
+            "persist.audio.mic.ultrasound";
+    private static final String SYSTEM_PROPERTY_SPEAKER_NEAR_ULTRASOUND =
+            "persist.audio.spkr.ultrasound";
+    private static final String DEFAULT_RESULT_FALSE_STRING = "false";
+
+    /**
      * Broadcast intent, a hint for applications that audio is about to become
      * 'noisy' due to a change in audio outputs. For example, this intent may
      * be sent when a wired headset is unplugged, or when an A2DP audio
@@ -3175,6 +3186,12 @@
         } else if (PROPERTY_OUTPUT_FRAMES_PER_BUFFER.equals(key)) {
             int outputFramesPerBuffer = AudioSystem.getPrimaryOutputFrameCount();
             return outputFramesPerBuffer > 0 ? Integer.toString(outputFramesPerBuffer) : null;
+        } else if (PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND.equals(key)) {
+            return SystemProperties.get(SYSTEM_PROPERTY_MIC_NEAR_ULTRASOUND,
+                    DEFAULT_RESULT_FALSE_STRING);
+        } else if (PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND.equals(key)) {
+            return SystemProperties.get(SYSTEM_PROPERTY_SPEAKER_NEAR_ULTRASOUND,
+                    DEFAULT_RESULT_FALSE_STRING);
         } else {
             // null or unknown key
             return null;