示例#1
0
/* native interface */
JNIEXPORT jint JNICALL
Java_android_drm_mobile1_DrmRawContent_nativeGetDeliveryMethod
  (JNIEnv * env, jobject rawContent)
{
    jint id;
    int32_t res;

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

    res = SVC_drm_getDeliveryMethod(id);

    switch (res) {
    case FORWARD_LOCK:
        return JNI_DRM_FORWARD_LOCK;
    case COMBINED_DELIVERY:
        return JNI_DRM_COMBINED_DELIVERY;
    case SEPARATE_DELIVERY:
        return JNI_DRM_SEPARATE_DELIVERY;
    case SEPARATE_DELIVERY_FL:
        return JNI_DRM_SEPARATE_DELIVERY_DM;
    default:
        return JNI_DRM_FAILURE;
    }
}
示例#2
0
Int32 CDrmRawContent::NativeGetDeliveryMethod()
{
    Int32 res = SVC_drm_getDeliveryMethod(mId);

    switch (res) {
    case FORWARD_LOCK:
        return IDrmRawContent::DRM_FORWARD_LOCK;
    case COMBINED_DELIVERY:
        return IDrmRawContent::DRM_COMBINED_DELIVERY;
    case SEPARATE_DELIVERY:
        return IDrmRawContent::DRM_SEPARATE_DELIVERY;
    case SEPARATE_DELIVERY_FL:
        return IDrmRawContent::DRM_SEPARATE_DELIVERY_DM;
    default:
        return JNI_DRM_FAILURE;
    }
}