Merge "AudioSystem: update framework channel capabilities" am: 249034de9d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1317754 Change-Id: I8de728097196b1acece91c1651d2ead7c6323f44
This commit is contained in:
@@ -2273,7 +2273,7 @@ android_media_AudioSystem_setSurroundFormatEnabled(JNIEnv *env, jobject thiz,
|
||||
return (jint)nativeToJavaStatus(status);
|
||||
}
|
||||
|
||||
static jint android_media_AudioSystem_get_FCC_8(JNIEnv *env, jobject thiz) {
|
||||
static jint android_media_AudioSystem_getMaxChannelCount(JNIEnv *env, jobject thiz) {
|
||||
return FCC_8;
|
||||
}
|
||||
|
||||
@@ -2672,14 +2672,16 @@ static const JNINativeMethod gEventHandlerMethods[] = {
|
||||
(void *)android_media_AudioSystem_eventHandlerFinalize},
|
||||
};
|
||||
|
||||
static const JNINativeMethod gGetFCC8Methods[] = {
|
||||
{"native_get_FCC_8", "()I", (void *)android_media_AudioSystem_get_FCC_8},
|
||||
static const JNINativeMethod gFrameworkCapabilities[] = {
|
||||
{"native_getMaxChannelCount", "()I", (void *)android_media_AudioSystem_getMaxChannelCount},
|
||||
};
|
||||
|
||||
int register_android_media_AudioSystem(JNIEnv *env)
|
||||
{
|
||||
// This needs to be done before hooking up methods AudioTrackRoutingProxy (below)
|
||||
RegisterMethodsOrDie(env, kClassPathName, gGetFCC8Methods, NELEM(gGetFCC8Methods));
|
||||
// as the calls are performed in the static initializer of AudioSystem.
|
||||
RegisterMethodsOrDie(env, kClassPathName, gFrameworkCapabilities,
|
||||
NELEM(gFrameworkCapabilities));
|
||||
|
||||
jclass arrayListClass = FindClassOrDie(env, "java/util/ArrayList");
|
||||
gArrayListClass = MakeGlobalRefOrDie(env, arrayListClass);
|
||||
|
||||
@@ -101,11 +101,19 @@ public class AudioSystem
|
||||
*/
|
||||
public static final int NUM_STREAMS = 5;
|
||||
|
||||
/** Maximum value for AudioTrack channel count
|
||||
* @hide public for MediaCode only, do not un-hide or change to a numeric literal
|
||||
/*
|
||||
* Framework static final constants that are primitives or Strings
|
||||
* accessed by CTS tests or internal applications must be set from methods
|
||||
* (or in a static block) to prevent Java compile-time replacement.
|
||||
* We set them from methods so they are read from the device framework.
|
||||
* Do not un-hide or change to a numeric literal.
|
||||
*/
|
||||
public static final int OUT_CHANNEL_COUNT_MAX = native_get_FCC_8();
|
||||
private static native int native_get_FCC_8();
|
||||
|
||||
/** Maximum value for AudioTrack channel count
|
||||
* @hide
|
||||
*/
|
||||
public static final int OUT_CHANNEL_COUNT_MAX = native_getMaxChannelCount();
|
||||
private static native int native_getMaxChannelCount();
|
||||
|
||||
// Expose only the getter method publicly so we can change it in the future
|
||||
private static final int NUM_STREAM_TYPES = 12;
|
||||
|
||||
Reference in New Issue
Block a user