summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Shunkai Yao <yaoshunkai@google.com> 2024-07-08 19:36:17 +0000
committer Shunkai Yao <yaoshunkai@google.com> 2024-07-08 21:41:57 +0000
commitb90e8e3579eb859faab8794da67e5b93885b1e61 (patch)
treefb8045e5cccc3594a0b55fbf95498f3dcaaf2c1a
parent8c8eb1e9f45f141e620eb59cd3259f4ef1d61d9b (diff)
replace the hardcode for min/max sample rate with audio.h in jni
Bug: 350550320 Test: atest AudioRecordTest AudioFormatTest AudioTrackTest Change-Id: Ie1941eeb42cb2708af3b6294059fc8574e7359a8
-rw-r--r--core/jni/android_media_AudioSystem.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 52237989f059..9fecbd344908 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -2703,12 +2703,11 @@ static jint android_media_AudioSystem_getMaxChannelCount(JNIEnv *env, jobject th
}
static jint android_media_AudioSystem_getMaxSampleRate(JNIEnv *env, jobject thiz) {
- // see frameworks/av/services/audiopolicy/common/include/policy.h
- return 192000; // SAMPLE_RATE_HZ_MAX (for API)
+ return SAMPLE_RATE_HZ_MAX;
}
static jint android_media_AudioSystem_getMinSampleRate(JNIEnv *env, jobject thiz) {
- return 4000; // SAMPLE_RATE_HZ_MIN (for API)
+ return SAMPLE_RATE_HZ_MIN;
}
static std::vector<uid_t> convertJIntArrayToUidVector(JNIEnv *env, jintArray jArray) {