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

Commit 250f6a74 authored by Robert Shih's avatar Robert Shih
Browse files

MediaDrm: detailed Exception messages continued

Exception types covered:
* UnsupportedSchemeException
* MediaDrmResetException

Bug: 162255728
Test: MediaDrmTest#testGetLogMessages
Change-Id: I4880035d3d8db5835b979cd6da064fe813d1f6b4
parent ea5f0427
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -445,8 +445,7 @@ static bool throwExceptionAsNecessary(
        jniThrowException(env, "android/media/DeniedByServerException", msg);
        return true;
    } else if (err == DEAD_OBJECT) {
        jniThrowException(env, "android/media/MediaDrmResetException",
                "mediaserver died");
        jniThrowException(env, "android/media/MediaDrmResetException", msg);
        return true;
    } else if (isSessionException(err)) {
        throwSessionException(env, msg, err);
@@ -967,10 +966,12 @@ static void android_media_MediaDrm_native_setup(
    status_t err = drm->initCheck();

    if (err != OK) {
        auto logs(DrmUtils::gLogBuf.getLogs());
        auto msg(DrmUtils::GetExceptionMessage(err, "Failed to instantiate drm object", logs));
        jniThrowException(
                env,
                "android/media/UnsupportedSchemeException",
                "Failed to instantiate drm object.");
                msg.c_str());
        return;
    }