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

Commit 33ae2f6d authored by Vlad Popa's avatar Vlad Popa
Browse files

Fix exception checking after native prepare call

Test: atest MediaPlayerUnitTest
Bug: 279575542
Change-Id: I33da791e4eabfc350b6e135795c067678e730752
parent 6856c694
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -385,6 +385,10 @@ android_media_MediaPlayer_prepare(JNIEnv *env, jobject thiz, jobject piidParcel)

    process_media_player_call( env, thiz, mp->prepare(), "java/io/IOException", "Prepare failed." );

    if (env->ExceptionCheck()) {
        return UNKNOWN_ERROR;
    }

    // update the piid
    Parcel *request = parcelForJavaObject(env, piidParcel);
    auto reply = std::make_unique<Parcel>();
@@ -407,6 +411,10 @@ android_media_MediaPlayer_prepareAsync(JNIEnv *env, jobject thiz, jobject piidPa

    process_media_player_call( env, thiz, mp->prepareAsync(), "java/io/IOException", "Prepare Async failed." );

    if (env->ExceptionCheck()) {
        return UNKNOWN_ERROR;
    }

    // update the piid
    Parcel *request = parcelForJavaObject(env, piidParcel);
    auto reply = std::make_unique<Parcel>();