Merge "audio: add API for querying the Ultrasound support"
This commit is contained in:
@@ -5563,6 +5563,7 @@ package android.media {
|
||||
method public boolean isAudioServerRunning();
|
||||
method public boolean isHdmiSystemAudioSupported();
|
||||
method @RequiresPermission(android.Manifest.permission.CALL_AUDIO_INTERCEPTION) public boolean isPstnCallAudioInterceptable();
|
||||
method public static boolean isUltrasoundSupported();
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void muteAwaitConnection(@NonNull int[], @NonNull android.media.AudioDeviceAttributes, long, @NonNull java.util.concurrent.TimeUnit) throws java.lang.IllegalStateException;
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int registerAudioPolicy(@NonNull android.media.audiopolicy.AudioPolicy);
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void registerMuteAwaitConnectionCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.MuteAwaitConnectionCallback);
|
||||
|
||||
@@ -2538,6 +2538,10 @@ android_media_AudioSystem_isHapticPlaybackSupported(JNIEnv *env, jobject thiz)
|
||||
return AudioSystem::isHapticPlaybackSupported();
|
||||
}
|
||||
|
||||
static jboolean android_media_AudioSystem_isUltrasoundSupported(JNIEnv *env, jobject thiz) {
|
||||
return AudioSystem::isUltrasoundSupported();
|
||||
}
|
||||
|
||||
static jint android_media_AudioSystem_setSupportedSystemUsages(JNIEnv *env, jobject thiz,
|
||||
jintArray systemUsages) {
|
||||
std::vector<audio_usage_t> nativeSystemUsagesVector;
|
||||
@@ -3018,6 +3022,7 @@ static const JNINativeMethod gMethods[] =
|
||||
{"setA11yServicesUids", "([I)I", (void *)android_media_AudioSystem_setA11yServicesUids},
|
||||
{"isHapticPlaybackSupported", "()Z",
|
||||
(void *)android_media_AudioSystem_isHapticPlaybackSupported},
|
||||
{"isUltrasoundSupported", "()Z", (void *)android_media_AudioSystem_isUltrasoundSupported},
|
||||
{"getHwOffloadFormatsSupportedForBluetoothMedia", "(ILjava/util/ArrayList;)I",
|
||||
(void *)android_media_AudioSystem_getHwOffloadFormatsSupportedForBluetoothMedia},
|
||||
{"setSupportedSystemUsages", "([I)I",
|
||||
|
||||
@@ -7240,6 +7240,24 @@ public class AudioManager {
|
||||
return AudioSystem.isHapticPlaybackSupported();
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* Indicates whether a platform supports the Ultrasound feature which covers the playback
|
||||
* and recording of 20kHz~ sounds. If platform supports Ultrasound, then the
|
||||
* usage will be
|
||||
* To start the Ultrasound playback:
|
||||
* - Create an AudioTrack with {@link AudioAttributes.CONTENT_TYPE_ULTRASOUND}.
|
||||
* To start the Ultrasound capture:
|
||||
* - Create an AudioRecord with {@link MediaRecorder.AudioSource.ULTRASOUND}.
|
||||
*
|
||||
* @return whether the ultrasound feature is supported, true when platform supports both
|
||||
* Ultrasound playback and capture, false otherwise.
|
||||
*/
|
||||
@SystemApi
|
||||
public static boolean isUltrasoundSupported() {
|
||||
return AudioSystem.isUltrasoundSupported();
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* Introspection API to retrieve audio product strategies.
|
||||
@@ -8379,4 +8397,4 @@ public class AudioManager {
|
||||
return mHandler;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1869,6 +1869,12 @@ public class AudioSystem
|
||||
*/
|
||||
public static native boolean isHapticPlaybackSupported();
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* @see AudioManager#isUltrasoundSupported()
|
||||
*/
|
||||
public static native boolean isUltrasoundSupported();
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* Send audio HAL server process pids to native audioserver process for use
|
||||
|
||||
Reference in New Issue
Block a user