Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47519463 authored by Jay Patel's avatar Jay Patel Committed by Automerger Merge Worker
Browse files

Merge "AudioSystem: update framework channel capabilities" am: 249034de

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1317754

Change-Id: I35ed1d26586628e30f7f9a17c3c624c0cd9ae8b3
parents cb6f2ce8 249034de
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -2273,7 +2273,7 @@ android_media_AudioSystem_setSurroundFormatEnabled(JNIEnv *env, jobject thiz,
    return (jint)nativeToJavaStatus(status);
    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;
    return FCC_8;
}
}


@@ -2672,14 +2672,16 @@ static const JNINativeMethod gEventHandlerMethods[] = {
        (void *)android_media_AudioSystem_eventHandlerFinalize},
        (void *)android_media_AudioSystem_eventHandlerFinalize},
};
};


static const JNINativeMethod gGetFCC8Methods[] = {
static const JNINativeMethod gFrameworkCapabilities[] = {
    {"native_get_FCC_8", "()I", (void *)android_media_AudioSystem_get_FCC_8},
        {"native_getMaxChannelCount", "()I", (void *)android_media_AudioSystem_getMaxChannelCount},
};
};


int register_android_media_AudioSystem(JNIEnv *env)
int register_android_media_AudioSystem(JNIEnv *env)
{
{
    // This needs to be done before hooking up methods AudioTrackRoutingProxy (below)
    // 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");
    jclass arrayListClass = FindClassOrDie(env, "java/util/ArrayList");
    gArrayListClass = MakeGlobalRefOrDie(env, arrayListClass);
    gArrayListClass = MakeGlobalRefOrDie(env, arrayListClass);
+11 −3
Original line number Original line Diff line number Diff line
@@ -101,11 +101,19 @@ public class AudioSystem
     */
     */
    public static final int NUM_STREAMS = 5;
    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
    /** 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();
    public static final int OUT_CHANNEL_COUNT_MAX = native_getMaxChannelCount();
    private static native int native_get_FCC_8();
    private static native int native_getMaxChannelCount();


    // Expose only the getter method publicly so we can change it in the future
    // Expose only the getter method publicly so we can change it in the future
    private static final int NUM_STREAM_TYPES = 12;
    private static final int NUM_STREAM_TYPES = 12;