Loading core/res/res/values/config.xml +9 −0 Original line number Diff line number Diff line Loading @@ -2178,4 +2178,13 @@ Defaults to the older, deprecated config_windowIsRound already used in some existing device-specific resource overlays. --> <bool name="config_mainBuiltInDisplayIsRound">@bool/config_windowIsRound</bool> <!-- Ultrasound support for Mic/speaker path --> <!-- Whether the default microphone audio source supports near-ultrasound frequencies (range of 18 - 21 kHz). --> <bool name="config_supportMicNearUltrasound">true</bool> <!-- Whether the default speaker audio output path supports near-ultrasound frequencies (range of 18 - 21 kHz). --> <bool name="config_supportSpeakerNearUltrasound">true</bool> </resources> core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -301,6 +301,8 @@ <java-symbol type="bool" name="config_wifi_only_link_same_credential_configurations" /> <java-symbol type="bool" name="config_wifi_enable_disconnection_debounce" /> <java-symbol type="bool" name="config_wifi_enable_5GHz_preference" /> <java-symbol type="bool" name="config_supportMicNearUltrasound" /> <java-symbol type="bool" name="config_supportSpeakerNearUltrasound" /> <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_boost_threshold" /> <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_boost_factor" /> <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_penalty_threshold" /> Loading media/java/android/media/AudioManager.java +6 −15 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ import android.os.Looper; 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; Loading Loading @@ -68,16 +67,6 @@ public class AudioManager { private static String TAG = "AudioManager"; 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 Loading Loading @@ -3213,11 +3202,13 @@ public class AudioManager { 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); // Will throw a RuntimeException Resources.NotFoundException if this config value is // not found. return String.valueOf(getContext().getResources().getBoolean( com.android.internal.R.bool.config_supportMicNearUltrasound)); } else if (PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND.equals(key)) { return SystemProperties.get(SYSTEM_PROPERTY_SPEAKER_NEAR_ULTRASOUND, DEFAULT_RESULT_FALSE_STRING); return String.valueOf(getContext().getResources().getBoolean( com.android.internal.R.bool.config_supportSpeakerNearUltrasound)); } else { // null or unknown key return null; Loading Loading
core/res/res/values/config.xml +9 −0 Original line number Diff line number Diff line Loading @@ -2178,4 +2178,13 @@ Defaults to the older, deprecated config_windowIsRound already used in some existing device-specific resource overlays. --> <bool name="config_mainBuiltInDisplayIsRound">@bool/config_windowIsRound</bool> <!-- Ultrasound support for Mic/speaker path --> <!-- Whether the default microphone audio source supports near-ultrasound frequencies (range of 18 - 21 kHz). --> <bool name="config_supportMicNearUltrasound">true</bool> <!-- Whether the default speaker audio output path supports near-ultrasound frequencies (range of 18 - 21 kHz). --> <bool name="config_supportSpeakerNearUltrasound">true</bool> </resources>
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -301,6 +301,8 @@ <java-symbol type="bool" name="config_wifi_only_link_same_credential_configurations" /> <java-symbol type="bool" name="config_wifi_enable_disconnection_debounce" /> <java-symbol type="bool" name="config_wifi_enable_5GHz_preference" /> <java-symbol type="bool" name="config_supportMicNearUltrasound" /> <java-symbol type="bool" name="config_supportSpeakerNearUltrasound" /> <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_boost_threshold" /> <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_boost_factor" /> <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_penalty_threshold" /> Loading
media/java/android/media/AudioManager.java +6 −15 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ import android.os.Looper; 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; Loading Loading @@ -68,16 +67,6 @@ public class AudioManager { private static String TAG = "AudioManager"; 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 Loading Loading @@ -3213,11 +3202,13 @@ public class AudioManager { 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); // Will throw a RuntimeException Resources.NotFoundException if this config value is // not found. return String.valueOf(getContext().getResources().getBoolean( com.android.internal.R.bool.config_supportMicNearUltrasound)); } else if (PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND.equals(key)) { return SystemProperties.get(SYSTEM_PROPERTY_SPEAKER_NEAR_ULTRASOUND, DEFAULT_RESULT_FALSE_STRING); return String.valueOf(getContext().getResources().getBoolean( com.android.internal.R.bool.config_supportSpeakerNearUltrasound)); } else { // null or unknown key return null; Loading