Loading core/jni/android_media_AudioSystem.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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); Loading media/java/android/media/AudioSystem.java +11 −3 Original line number Diff line number Diff line Loading @@ -101,11 +101,19 @@ public class AudioSystem */ public static final int NUM_STREAMS = 5; /* * 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. */ /** Maximum value for AudioTrack channel count * @hide public for MediaCode only, do not un-hide or change to a numeric literal * @hide */ public static final int OUT_CHANNEL_COUNT_MAX = native_get_FCC_8(); private static native int native_get_FCC_8(); 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; Loading Loading
core/jni/android_media_AudioSystem.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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); Loading
media/java/android/media/AudioSystem.java +11 −3 Original line number Diff line number Diff line Loading @@ -101,11 +101,19 @@ public class AudioSystem */ public static final int NUM_STREAMS = 5; /* * 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. */ /** Maximum value for AudioTrack channel count * @hide public for MediaCode only, do not un-hide or change to a numeric literal * @hide */ public static final int OUT_CHANNEL_COUNT_MAX = native_get_FCC_8(); private static native int native_get_FCC_8(); 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; Loading