Example #1
0
Int32 CDrmRawContent::NativeGetContentLength()
{
    Int32 len = SVC_drm_getContentLength(mId);

    if (DRM_UNKNOWN_DATA_LEN == len)
        return CDrmRawContent::JNI_DRM_UNKNOWN_DATA_LEN;

    if (0 > len)
        return CDrmRawContent::JNI_DRM_FAILURE;

    return len;
}
Example #2
0
/* native interface */
JNIEXPORT jint JNICALL
Java_android_drm_mobile1_DrmRawContent_nativeGetContentLength
  (JNIEnv * env, jobject rawContent)
{
    jint id;
    int32_t len;

    if (JNI_DRM_FAILURE == getObjectIntField(env, rawContent, "id", &id))
        return JNI_DRM_FAILURE;

    len = SVC_drm_getContentLength(id);

    if (DRM_UNKNOWN_DATA_LEN == len)
        return JNI_DRM_UNKNOWN_DATA_LEN;

    if (0 > len)
        return JNI_DRM_FAILURE;

    return len;
}