Fix exception checking after native prepare call

Test: atest MediaPlayerUnitTest
Bug: 279575542
Change-Id: I33da791e4eabfc350b6e135795c067678e730752
This commit is contained in:
Vlad Popa
2023-04-25 17:44:36 +02:00
parent 6856c69444
commit 33ae2f6d60

View File

@@ -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>();