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

Commit cdf8df00 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Convert mask types from uint32_t to enum type" am: bcc75f0b am: 5ffb396f

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

Change-Id: I3952e9eb131cc47464484b2f36fa35e3476d819a
parents ccc3d0f1 5ffb396f
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ static jint getVectorOfAudioDeviceTypeAddr(JNIEnv *env, jintArray deviceTypes,
            return (jint)AUDIO_JAVA_BAD_VALUE;
        }
        const char *address = env->GetStringUTFChars((jstring)addrJobj, NULL);
        AudioDeviceTypeAddr dev = AudioDeviceTypeAddr(typesPtr[i], address);
        AudioDeviceTypeAddr dev = AudioDeviceTypeAddr((audio_devices_t)typesPtr[i], address);
        audioDeviceTypeAddrVector.add(dev);
        env->ReleaseStringUTFChars((jstring)addrJobj, address);
    }
@@ -818,7 +818,8 @@ static void convertAudioGainConfigToNative(JNIEnv *env,
                                               bool useInMask)
{
    nAudioGainConfig->index = env->GetIntField(jAudioGainConfig, gAudioGainConfigFields.mIndex);
    nAudioGainConfig->mode = env->GetIntField(jAudioGainConfig, gAudioGainConfigFields.mMode);
    nAudioGainConfig->mode =
            (audio_gain_mode_t)env->GetIntField(jAudioGainConfig, gAudioGainConfigFields.mMode);
    ALOGV("convertAudioGainConfigToNative got gain index %d", nAudioGainConfig->index);
    jint jMask = env->GetIntField(jAudioGainConfig, gAudioGainConfigFields.mChannelMask);
    audio_channel_mask_t nMask;
@@ -938,8 +939,8 @@ static jint convertAudioPortConfigToNativeWithDevicePort(JNIEnv *env,

    jobject jAudioDevicePort = env->GetObjectField(jAudioPortConfig,
            gAudioPortConfigFields.mPort);
    nAudioPortConfig->ext.device.type = env->GetIntField(jAudioDevicePort,
            gAudioPortFields.mType);
    nAudioPortConfig->ext.device.type =
            (audio_devices_t)env->GetIntField(jAudioDevicePort, gAudioPortFields.mType);
    jstring jDeviceAddress = (jstring)env->GetObjectField(jAudioDevicePort,
            gAudioPortFields.mAddress);
    const char *nDeviceAddress = env->GetStringUTFChars(jDeviceAddress, NULL);
@@ -2332,7 +2333,7 @@ static jint android_media_AudioSystem_setSupportedSystemUsages(JNIEnv *env, jobj

static jint
android_media_AudioSystem_setAllowedCapturePolicy(JNIEnv *env, jobject thiz, jint uid, jint flags) {
    return AudioSystem::setAllowedCapturePolicy(uid, flags);
    return AudioSystem::setAllowedCapturePolicy(uid, static_cast<audio_flags_mask_t>(flags));
}

static jint
@@ -2368,7 +2369,9 @@ android_media_AudioSystem_setPreferredDeviceForStrategy(JNIEnv *env, jobject thi
    const char *c_address = env->GetStringUTFChars(deviceAddress, NULL);
    int status = check_AudioSystem_Command(
            AudioSystem::setPreferredDeviceForStrategy((product_strategy_t)strategy,
                    AudioDeviceTypeAddr(deviceType, c_address)));
                                                       AudioDeviceTypeAddr((audio_devices_t)
                                                                                   deviceType,
                                                                           c_address)));
    env->ReleaseStringUTFChars(deviceAddress, c_address);
    return (jint) status;
}
+1 −1
Original line number Diff line number Diff line
@@ -331,7 +331,7 @@ android_media_AudioEffect_native_setup(JNIEnv *env, jobject thiz, jobject weak_t
    }

    if (deviceType != AUDIO_DEVICE_NONE) {
        device.mType = deviceType;
        device.mType = (audio_devices_t)deviceType;
        ScopedUtfChars address(env, deviceAddress);
        device.mAddress = address.c_str();
    }
+1 −1
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ android_media_SoundPool_native_setup(JNIEnv *env, jobject thiz, jobject weakRef,
    paa->usage = (audio_usage_t) env->GetIntField(jaa, javaAudioAttrFields.fieldUsage);
    paa->content_type =
            (audio_content_type_t) env->GetIntField(jaa, javaAudioAttrFields.fieldContentType);
    paa->flags = env->GetIntField(jaa, javaAudioAttrFields.fieldFlags);
    paa->flags = (audio_flags_mask_t) env->GetIntField(jaa, javaAudioAttrFields.fieldFlags);

    ALOGV("android_media_SoundPool_native_setup");
    auto *ap = new SoundPool(maxChannels, paa);