Example usage for android.media DeniedByServerException toString

List of usage examples for android.media DeniedByServerException toString

Introduction

In this page you can find the example usage for android.media DeniedByServerException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:org.chromium.media.MediaDrmBridge.java

/**
 * Provide the provisioning response to MediaDrm.
 * @returns false if the response is invalid or on error, true otherwise.
 *//* ww  w.j a  va2  s  .  com*/
boolean provideProvisionResponse(byte[] response) {
    if (response == null || response.length == 0) {
        Log.e(TAG, "Invalid provision response.");
        return false;
    }

    try {
        mMediaDrm.provideProvisionResponse(response);
    } catch (android.media.DeniedByServerException e) {
        Log.e(TAG, "failed to provide provision response: " + e.toString());
        return false;
    } catch (java.lang.IllegalStateException e) {
        Log.e(TAG, "failed to provide provision response: " + e.toString());
        return false;
    }

    if (mPendingInitData != null) {
        assert (!mResetDeviceCredentialsPending);
        byte[] initData = mPendingInitData;
        mPendingInitData = null;
        generateKeyRequest(initData, mMimeType);
    }
    return true;
}